the susres process timeout timer was not cancellable, which means
that there was always a timeout pending regardless of the
success or failure of a suspend/resume process.
This fixes the implementation so that the timer is cancelled
in the case of a successful suspend/resume.
- move susres service up in order
- move clock mangaer up
- move i2c into its own thread
- move keyboard server down
- add centralized hnadlers for perclk update
- TODO: actually call perclk update on perclk changes
(but at least now both ADC and I2C have a hook for updating)
- make main loop stall at the end by calling a dummy server
- This reduces CPU load by removing a future-dummy-wait timer
a bit convoluted:
- RTC wakeup goes through the "always on" subsystem
- keyboard routes through "always on" because the system can wake
on keyboard press
- thus the keyboard mechanism is abused/re-used to pass wakeup
events throughout the system.
Other notes - a wakeup alarm sent within 2 seconds of the current
time will trigger an assert. It's not recommended to use the RTC
for very near-term wakeups because if you e.g. hit swap or have
something else going on that's very "busy" (like QR code scanning)
the system might not get to waking things up in time.
Some code can be written to handle this and set up a degenerate
wakeup, maybe, but for now, I am leaving it as an assert because
I want to remind myself that there is an edge case here.
the commited code works, but there's something weird going on
with the clock setting math that indicates i'm not understanding
exactly what's going on. Need to move on and solve other problems,
but this will be an outstanding issue.
this allows the ADC to depend on core HAL services. It's structured
so that other 'misc' services would go into the "other" module,
just to keep the overhead of threads/services down a bit. Up until
this point all the other services mapped to existing/other
server names, like the RTC, susres, etc.
this allows the BIO to continue to function even though
the CPU core is in WFI. It isn't running at full speed, but
for some applications (such as WS2812 LED driving) the lower
speed is perfectly adequate and you save a lot of power
by turning off the CPU core.
this requires a PlatformSpecific extension to the
susres API.
In addition to that, a DeepSleep op is added so we're
no longer overloading the meaning of the SuspendRequest
operation.
this one is a little bit tricky. The lite version of baosec
forgoes the off-chip TRNG to save cost. Thus, there is an
"anti-feature" in the configuration, and so in this case
the dabao version of the server has to be selected despite
the baosec flag.