aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster
diff options
context:
space:
mode:
authorSelene ToyKeeper2017-09-10 02:37:39 -0600
committerSelene ToyKeeper2017-09-10 02:37:39 -0600
commitd4a3e889ec53155a913763a52fd4a82bee14d95c (patch)
tree2a2941b2e4ff02ef27a65b29cdb1f1328eccb3d3 /spaghetti-monster
parentAdjusted thermal regulation based on results of some handheld runtime tests. (diff)
downloadanduril-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 'spaghetti-monster')
-rw-r--r--spaghetti-monster/anduril/anduril.c15
-rw-r--r--spaghetti-monster/fsm-events.h21
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
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.