Hi Sterling,
One other important question is what happens when we don't respect the
read request intervals between data samples?
In the accel sim (really nice to see sim examples, BTW ... that's
extremely useful to test sensor algorithms), you just check the number
of missing samples from the last interval and generate that many new
samples to fill the gaps:
https://github.com/apache/incubator-mynewt-core/compare/develop...sensors_branch#diff-1c17a623363565318dfefdb8891c0376R148
A lot of DSP algorithms are timing sensitive, though, such as sensor
fusion with accel/mag/gyro inputs, where you want to samples as close as
possible to a fixed rate like 50Hz or 100Hz, and the three components
read together as closely as possible (though timestamp at least lest you
know the difference between components).
Raising some sort of alert when a sample is missed might be a better
choice, or having the option to indicate which of the two behaviours
should be used by the timer when a sample interval is missed:
- 1. Read multiple values (default behaviour?)
- 2. Raise a missing sample alert
- 3. ???
Kevin