This fixes a bug in the bridge power controller's subsampling behavior, often used with RBR sensors. Prior to this change, if subsampling was enabled, and if the end of the sample duration fell between the end of the last subsample duration and the start of the next aligned sample interval, then the start of the next sample interval would actually again leave the bus off to align to the next sample interval.
I added some unit tests involving a couple different cases of subsampling.
The fix is essentially to avoid sleeping across that end-of-sample-duration boundary, allowing the power controller to wake up and align the next sample before it starts.
[sc-201530]
This fixes a bug in the bridge power controller's subsampling behavior, often used with RBR sensors. Prior to this change, if subsampling was enabled, and if the end of the sample duration fell between the end of the last subsample duration and the start of the next aligned sample interval, then the start of the next sample interval would actually again leave the bus off to align to the next sample interval.
I added some unit tests involving a couple different cases of subsampling.
The fix is essentially to avoid sleeping across that end-of-sample-duration boundary, allowing the power controller to wake up and align the next sample before it starts.