InfiniTime icon indicating copy to clipboard operation
InfiniTime copied to clipboard

SystemTask state refactor

Open mark9064 opened this issue 1 year ago • 2 comments

Currently SystemTask is somewhat fragile to duplicate state transitions and unusual state transition message orders. Most notably this can cause it to get stuck in GoingToSleep in some scenarios.

This PR introduces GoToSleep() and changes GoToRunning() as immediately executable functions. The guarantee that state transitions happen immediately reduces complexity when it comes to ensuring the device is awake for events such as Chimes

Fixes part of #1790 #2012 (there may be other issues contributing to these, but this is probably part of it)

mark9064 avatar Aug 23 '24 13:08 mark9064

Build size and comparison to main:

Section Size Difference
text 378868B -32B
data 948B 0B
bss 63488B 0B

github-actions[bot] avatar Aug 23 '24 13:08 github-actions[bot]

Inverted state check to make adding new states smoother

mark9064 avatar Aug 25 '24 22:08 mark9064

I'm pretty terrible at graphics but I'll give it a go!

mark9064 avatar Sep 14 '24 10:09 mark9064

Updating InfiniSim to support the newly used function uxQueueMessagesWaiting https://github.com/InfiniTimeOrg/InfiniSim/pull/151

NeroBurner avatar Sep 21 '24 18:09 NeroBurner