Closed ourairquality closed 6 years ago
Looks like a sane implementation to me :) Makes it also more easy and explicit to detect situations where the slave is stretching for too long.
I just wonder if the spin count should depend on the CPU frequency. Probably it won't matter too much, though.
This also redefines the timeout in FreeRTOS clock ticks, and implements a two stage wait: firstly spinning sampling frequently, and then falling back to a longer wait while sampling less frequently and yielding.