It may be nice to schedule the reading some the onboard environment sensors (temperature, humidity, current, thermistors) as a "background" process which can progressively cycle through the list of sensors and do various device writes / read in a nonblocking way and then cache the results or errors that occur.
This could help prevent the main logic from ever getting blocked and would always have a recent reading of a sensor value or error ready.
It may be nice to schedule the reading some the onboard environment sensors (temperature, humidity, current, thermistors) as a "background" process which can progressively cycle through the list of sensors and do various device writes / read in a nonblocking way and then cache the results or errors that occur.
This could help prevent the main logic from ever getting blocked and would always have a recent reading of a sensor value or error ready.