rrivirr / rriv

GNU General Public License v3.0
1 stars 9 forks source link

Consolidate sensor read cycle timing into a single variable/method #104

Open ZavenArra opened 1 year ago

ZavenArra commented 1 year ago

Currently the Sensor base class exposes two functions involved in setting the length of the sensor read cycle:

virtual unsigned int millisecondsUntilNextReadingAvailable();

virtual unsigned int millisecondsUntilNextRequestedReading();

Instead, we want to consolidate this logic into a single function. The developer implementing the driver can determine if the read cycle length is an unchangeable parameter of the sensor itself (as in a digital sensor), or configurable by the user (as might be useful for an analog sensor). If the parameter is configurable by the user, then the developer implementing the driver is tasked with determining that the value requested is in a valid range.