aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster/fsm-events.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fixed the corner case of a button release when the previous state was ↵Selene ToyKeeper2018-11-111-1/+1
| | | | already released.
* Several fixes...Selene ToyKeeper2018-11-111-4/+9
| | | | | | | | | | - Made momentary+lockout modes smaller and work better. - Fixed buggy timing on hold events; made ticks_since_last_event reset when it should. - Reduced ROM size by caching volatile ticks_since_last_event sometimes. - Swapped what the top Event bit means, because it makes event handlers easier to write. - Made the maximum click event keep triggering if user keeps pressing, instead of dropping everything after the limit.
* Rewrote the event system to use a single byte for each event instead of an ↵Selene ToyKeeper2018-11-111-67/+29
| | | | | | | array of actions. Not thoroughly tested yet, not done yet, have only updated Anduril to fit, and only partially.
* fixed bug: clicking MAX_CLICKS+1 times and holding the final click would ↵Selene ToyKeeper2018-09-071-4/+8
| | | | | | | hang the MCU (also, reduced ROM size)
* Fixed bug introduced in trunk r211.1.9, where Anduril's goodnight mode ↵Selene ToyKeeper2018-09-011-2/+6
| | | | | | | | didn't work sometimes. The problem was that goodnight's EV_enter was executing before battcheck's loop() finished. This meant battcheck's exit code would turn the emitter off right after goodnight's init set it to the desired level.
* Reduced ROM size by making successive nice_delay_ms calls collapse any time ↵Selene ToyKeeper2018-08-221-1/+7
| | | | | | | | | the user completes an input sequence. All nice delays then get aborted until the next trip through the main() loop. Eliminates the need to wrap nice_delay_ms() calls and handle the exit condition. Also eliminates the risk of getting the UI out of sync with button events.
* Use either full or quarter speed in nice delays, based on output level.Selene ToyKeeper2017-10-011-1/+19
| | | | | | This fixes issues with some blinky modes being audible (particularly biking and lightning modes), without sacrificing the power savings for other blinkies (like beacon and battcheck).
* Added dynamic underclocking to FSM, instead of doing it manually in Anduril.Selene ToyKeeper2017-09-261-0/+30
|
* Got the 4th PWM channel to work, ish. (channel 4 is inverted though)Selene ToyKeeper2017-09-031-4/+0
| | | | | | | | | Moved go_to_suspend thing into main() instead of making each UI handle that during loop(). Made default_state() optional. Fixed bug where battcheck and other number readouts could interfere with the state which interrupted them. (they would sometimes turn the LED off after the new state had already started) Updated darkhorse's moon levels to match new ramp on D4 hardware.
* Fixed a crash when user presses the button more times than the UI supports.Selene ToyKeeper2017-08-281-1/+1
| | | | | (need to leave room for a trailing 0 in the array, oops)
* Added beacons/strobes to DarkHorse.Selene ToyKeeper2017-08-261-1/+6
| | | | | Added a way to explicitly cancel the current "nice" delay without changing state.
* Added battcheck mode to ramping-ui. It's bigger than I had hoped. :(Selene ToyKeeper2017-08-251-0/+12
| | | | | | Added fsm-misc.*, which currently only has interruptible blink functions in it. (for blinking out numbers and such)
* Added loop() to API, executes constantly.Selene ToyKeeper2017-08-241-0/+23
| | | | | | Added nice_delay_ms() to process events while waiting, and abort on state change. Converted ramping-ui strobe to smoothly variable with party and tactical modes.
* Completely reorganized SpaghettiMonster code into smaller logical pieces: ↵Selene ToyKeeper2017-08-191-0/+137
fsm-*.c and fsm-*.h.