Commit Graph

18 Commits

Author SHA1 Message Date
true cf209fce4d possibly fix wasted power in idle mode
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.
2025-04-28 20:19:36 -07:00
Brooke 4d58a3df74 LEDs now operating on button push
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
2025-04-28 21:07:46 -04:00
true 9827a8f6be don't run timers in stop mode while debugging 2025-04-27 21:37:56 -07:00
true 57f7b1b48d fix setting clock divider to /1 when it should be /2
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.
2025-04-27 21:36:50 -07:00
Brooke 8692b71fd8 Fix several bugs 2025-04-28 00:00:41 -04:00
true 8a0430f137 fix not sending last frame to LEDs
also, clarified comments a bit
2025-04-23 19:53:59 -07:00
true d8d2677f54 fix some mistakes 2025-04-23 09:58:29 -07:00
true 70b9fe0dd6 migrate code to AS7, including fucked up arduino import
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.
2025-04-23 01:42:39 -07:00
true 1c34e1228f more boilerplate and cleanup 2025-04-04 03:05:42 -07:00
true 010eeae72f fix bugs in circle fade program 2025-04-04 03:01:05 -07:00
true 0ac7f4e7e2 changed code to match board; fixed a couple bugs
was able to put the button on PA2 and confirm PA1 for the LED data. because we're using PA2 for the button, we have async sleep support and no longer need to do all the button checks and mitigations for the partial-async pin which was used before.

compiled code size is slightly larger after removal of mitigations and other minor fixes...
2025-04-04 02:58:24 -07:00
true e614e47d4a add circle spin fadeout whatever program 2025-04-04 00:35:34 -07:00
true 9413b9997a broke out interrupts into isr.cpp 2025-04-03 14:41:33 -07:00
true b5bf65fead more cleanup and clarity 2025-04-03 14:21:48 -07:00
true 3607db3c4c add hsv2rgb; rainbow puke should work now 2025-04-03 14:18:28 -07:00
true c1d0fef585 expanded comments, minor cleanups, minor fixes
fixed inconsistent timing when re-enabling TCB0 timer
fixed sleep wake on button release causes a fast frame bug
2025-04-03 14:06:21 -07:00
true 5b73fd93d3 add main.cpp header comments describing expected operation 2025-04-02 21:48:58 -07:00
true 5f0a0feed1 initial commit of in-progress platformio/arduino code 2025-04-02 21:37:50 -07:00