OPEnSLab-OSU / ednaServer

GNU Affero General Public License v3.0
4 stars 0 forks source link

Sample Now and Scheduled Task Interference #16

Closed NathanJesudason closed 1 year ago

NathanJesudason commented 2 years ago

What causes this? When triggering a scheduled task with the RTC interrupt, this would also trigger the interrupt for a sample now task. Because there was no hard-coded validation to prevent both running at the same time, both would end up running at the same time.

What does this problem look like? When would someone experience this problem? It would look like tasks are skipping around or multiple valves are being set to active at once.

How to resolve/avoid this issue? We resolved this issue by first disabling interrupts once a callback was being called, and then adding validation so that beingNowTask() and scheduleNextActiveTask() do nothing if there's a task running.

Additional context Issue resolved.

NathanJesudason commented 2 years ago

Issue discovered where it can sometimes mistake an RTC interrupt for a button press. Added RTC alarm check in the callback of the sample now button