diff options
| author | Selene ToyKeeper | 2017-09-10 02:37:39 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2017-09-10 02:37:39 -0600 |
| commit | d4a3e889ec53155a913763a52fd4a82bee14d95c (patch) | |
| tree | 2a2941b2e4ff02ef27a65b29cdb1f1328eccb3d3 | |
| parent | Adjusted thermal regulation based on results of some handheld runtime tests. (diff) | |
| download | anduril-d4a3e889ec53155a913763a52fd4a82bee14d95c.tar.gz anduril-d4a3e889ec53155a913763a52fd4a82bee14d95c.tar.bz2 anduril-d4a3e889ec53155a913763a52fd4a82bee14d95c.zip | |
Moved strobes from 5 clicks to "click, click, long-click".
Moved momentary mode from 6 clicks to 5 clicks.
Diffstat (limited to '')
| -rw-r--r-- | spaghetti-monster/anduril/anduril.c | 15 | ||||
| -rw-r--r-- | spaghetti-monster/fsm-events.h | 21 |
2 files changed, 28 insertions, 8 deletions
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c index 91a74b2..6cc0095 100644 --- a/spaghetti-monster/anduril/anduril.c +++ b/spaghetti-monster/anduril/anduril.c @@ -30,7 +30,7 @@ #define RAMP_LENGTH 150 #define USE_BATTCHECK #define BATTCHECK_VpT -#define MAX_CLICKS 6 +#define MAX_CLICKS 5 #define USE_EEPROM #define EEPROM_BYTES 12 #include "spaghetti-monster.h" @@ -169,20 +169,19 @@ uint8_t off_state(EventPtr event, uint16_t arg) { return MISCHIEF_MANAGED; } #endif + // click, click, long-click: strobe mode + else if (event == EV_click3_hold) { + set_state(strobe_state, 0); + return MISCHIEF_MANAGED; + } // 4 clicks: soft lockout else if (event == EV_4clicks) { blink_confirm(2); set_state(lockout_state, 0); return MISCHIEF_MANAGED; } - // 5 clicks: strobe mode - // TODO: remap this to click, click, long-click? + // 5 clicks: momentary mode else if (event == EV_5clicks) { - set_state(strobe_state, 0); - return MISCHIEF_MANAGED; - } - // 6 clicks: momentary mode - else if (event == EV_6clicks) { blink_confirm(1); set_state(momentary_state, 0); return MISCHIEF_MANAGED; diff --git a/spaghetti-monster/fsm-events.h b/spaghetti-monster/fsm-events.h index c77facd..074b459 100644 --- a/spaghetti-monster/fsm-events.h +++ b/spaghetti-monster/fsm-events.h @@ -166,6 +166,25 @@ Event EV_click3_press[] = { A_RELEASE, A_PRESS, 0 }; +Event EV_click3_hold[] = { + A_PRESS, + A_RELEASE, + A_PRESS, + A_RELEASE, + A_PRESS, + A_HOLD, + 0 }; +/* +Event EV_click3_hold_release[] = { + A_PRESS, + A_RELEASE, + A_PRESS, + A_RELEASE, + A_PRESS, + A_HOLD, + A_RELEASE, + 0 }; + */ Event EV_click3_release[] = { A_PRESS, A_RELEASE, @@ -402,6 +421,8 @@ EventPtr event_sequences[] = { #endif #if MAX_CLICKS >= 3 EV_click3_press, + EV_click3_hold, + //EV_click3_hold_release, EV_click3_release, EV_click3_complete, #endif |
