arduino uses TCA timer to do its things. it doesn't need to do anything
while the MCU is in low power sleep. disable TCA whenever entering sleep
from user code.
note that the prior "working" demo commented using the rgb_run_next sleep
loop in the program. was still diagnosing issues with TCB0 interrupt.
if there's still issues waking from idle with TCB interrupt, then things
will still need to be addressed...
this fix is untested.
Fixed several bugs:
- TCB wasn't running. The datasheet steps were not complete.
- TCA was waking the MCU and causing the main program to run. Added checks
to ensure program only runs on button or TCB wakeup.
- Fixed some peculiarities with specific RGBLED programs
misinterpreted docs. too much ARM in my life.
the system sets up the clock divider with /2 and expects it to stay there.
was setting the divider to /1 thinking it only affected peripherals.
adjusted timings to compensate for the new divider.
arduino as a library will not build with -flto. I can't figure it out. so we
waste some space compared to what platformio was building. oh well. there's
still over 1K of space left for programs.