aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster/fsm-events.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* reorganized project files (part 1)Selene ToyKeeper2023-11-021-221/+0
| | | | | (just moved files, didn't change the contents yet, and nothing will work without updating #includes and build scripts and stuff)
* fixed delay timing on attiny1616 (it was about 17% too long this whole time)Selene ToyKeeper2023-10-291-3/+3
| | | | | (and re-adjusted smooth step timing accordingly)
* converted noctigon-dm11-boost to use PWM+DSM, and recalibrated timing for ↵Selene ToyKeeper2023-10-291-0/+5
| | | | | | | | | | delays + smooth steps Anduril has gradually gotten faster over the years, apparently, so it needed longer delays to get accurate-ish timing for beacon and other modes. Adding DSM also changes the timing perceptibly, so I made it possible to calibrate the delay fudge factor on a per-build basis.
* switched the rest of FSM + Anduril to use SPDX license headersSelene ToyKeeper2023-04-171-22/+4
| | | | | | | instead of full GPL headers (or all too often, nothing at all) There are a few "FIXME" entries where I'm not sure about the correct copyright.
* reorganized code in fsm-events.* to put things in a more coherent orderSelene ToyKeeper2020-09-141-35/+42
| | | | | | (no functional changes, but it does change the order of some code in ROM, so the compiled md5sum is different now)
* fixed bug: ticks_since_last_event wasn't getting reset on button hold releaseSelene ToyKeeper2020-09-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The visible symptom was: Ramp up for 1s or longer, release, wait more than 1s, then hold again. It should ramp up, but it would ramp down instead. The clause for resetting ramp_direction wasn't happening, because the EV_tick counter started at a value higher than 1s where it would normally trigger. The underlying cause was a bit complicated. Recent changes in PCINT_inner() were causing ticks_since_last_event to get set to 0 (at push_event()) and then back to its previous value (at emit_current_event()). The EV_tick counter would then start at whatever the button release event used. The fix involved removing the part of emit_current_event() where it would set ticks_since_last_event to "arg". That line was a very old bug which simply hadn't caused any visible issues until recently. Instead, it needs to set ticks_since_last_event more carefully, at other locations. Specifically, it resets to 0 now in empty_event_sequence() and one more location in the deferred WDT handler (when HOLD_TIMEOUT triggers). Additionally, push_event() was only ever used from PCINT_inner()... so I moved the tick reset logic to PCINT_inner() instead. This allows us to decrease size by about 10 bytes, since PCINT_inner() no longer needs to copy the counter before it gets reset. However, it also means push_event() should never be called from any other function.
* reduced ROM 42 bytes by making "emissions" non-volatileSelene ToyKeeper2020-07-291-1/+3
| | | | | (doesn't seem to be needed any more, ever since the IRQ rewrite a few months ago)
* fixed build of "momentary" example UISelene ToyKeeper2020-05-141-1/+1
|
* saving state of ADC / WDT refactoring before doing more changes... what ↵Selene ToyKeeper2020-01-301-0/+1
| | | | | | | | | | | | | | | changed so far: - removed LVP lowpass and thermal regulation lowpass logic; it's probably redundant now - slowed ADC deferred logic timing to 4X per second instead of 16X, because there doesn't seem to be much reason to do it any faster - reduced thermal event rate-limit to just 1 second, for more responsive regulation - added "EV_temperature_okay" signal, to help stop adjustments at an appropriate time instead of going to far - sped up sleep LVP to one measurement every 8 seconds instead of 16, to help the aux LEDs respond to voltage changes faster (effect on standby time is negligible) - make sure the WDT doesn't set the ADC channel or counter... except in standby mode
* made button release timeout faster (384ms -> 288ms) to make light shut off ↵Selene ToyKeeper2019-06-021-1/+1
| | | | sooner after 1 click
* Made event definitions a little cleaner.Selene ToyKeeper2018-11-111-32/+32
|
* Fixed the sleep tick counter wrapping around to 0 instead of 32768.Selene ToyKeeper2018-11-111-10/+5
|
* Several fixes...Selene ToyKeeper2018-11-111-3/+3
| | | | | | | | | | - 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-471/+136
| | | | | | | array of actions. Not thoroughly tested yet, not done yet, have only updated Anduril to fit, and only partially.
* Mostly got Emisar UI working... I think. Not yet tested.Selene ToyKeeper2018-06-261-0/+74
|
* Changed halfsleep mode to TICK_DURING_STANDBY. Added blinking indicator LED ↵Selene ToyKeeper2018-06-171-14/+13
| | | | support to Anduril.
* Implemented halfsleep mode.Selene ToyKeeper2018-06-171-0/+6
| | | | | | Will probably change it quite a bit though, so I'm checking in changes first. Needs to be "tick during standby" instead of "half sleep".
* Save a few bytes by changing how PCINT is defined.Selene ToyKeeper2018-01-241-2/+0
| | | | | Minor comment cleaning.
* Er, don't save_config() every frame... wait until the user lets go of the ↵Selene ToyKeeper2017-10-201-3/+1
| | | | button.
* Made HOLD_TIMEOUT and RELEASE_TIMEOUT define-able in the UI code.Selene ToyKeeper2017-10-061-0/+4
|
* Moved strobes from 5 clicks to "click, click, long-click".Selene ToyKeeper2017-09-101-0/+21
| | | | | Moved momentary mode from 6 clicks to 5 clicks.
* Started a Meteor M43 clone UI.Selene ToyKeeper2017-08-311-0/+168
| | | | | | | So far, UI1 and battcheck both work. UI2 and UI3 and other blinkies aren't implement yet. Added 6-bar battcheck style to match Meteor (ish). Increased maximum number of clicks to 12, because WTF. If your UI needs 12 clicks, what are you even doing in life?
* Ramp config mode actually works now...Selene ToyKeeper2017-08-271-9/+13
| | | | | | Added EV_reenter_state event to indicate an obscuring state was popped off the stack and the underlying one is now on top again.
* Made it easier to configure the maximum number of clicks it'll try to count ↵Selene ToyKeeper2017-08-271-1/+57
| | | | | | | | in one sequence. (use #define MAX_CLICKS 5, for example) Keeps data sizes from being excessively large without having to edit FSM sources per UI.
* Added eeprom load/save API (no wear levelling yet), verified it works in ↵Selene ToyKeeper2017-08-261-0/+8
| | | | DarkHorse.
* Added beacons/strobes to DarkHorse.Selene ToyKeeper2017-08-261-0/+1
| | | | | 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/+2
| | | | | | Added fsm-misc.*, which currently only has interruptible blink functions in it. (for blinking out numbers and such)
* Started on some documentation, spaghetti-monster.txt.Selene ToyKeeper2017-08-241-0/+5
| | | | | | | Added #defines for State return values: EVENT_HANDLED, EVENT_NOT_HANDLED Improved handling of delay includes. Managed mischief.
* Added loop() to API, executes constantly.Selene ToyKeeper2017-08-241-0/+3
| | | | | | 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.
* Made ramping UI able to toggle between smooth and discrete ramping with 4 ↵Selene ToyKeeper2017-08-241-0/+13
| | | | clicks.
* Added a ramping UI example.Selene ToyKeeper2017-08-241-0/+7
| | | | | Added ramping support in general.
* Completely reorganized SpaghettiMonster code into smaller logical pieces: ↵Selene ToyKeeper2017-08-191-0/+197
fsm-*.c and fsm-*.h.