aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2017-10-20 08:06:46 -0600
committerSelene ToyKeeper2017-10-20 08:06:46 -0600
commit5764a79e80ca35b7c5268b3580891b3b17768253 (patch)
tree93e83550a330b61a6a8b1b32451dd05377e8e842
parentAdded Q8 indicator LED support to Anduril. (diff)
downloadanduril-5764a79e80ca35b7c5268b3580891b3b17768253.tar.gz
anduril-5764a79e80ca35b7c5268b3580891b3b17768253.tar.bz2
anduril-5764a79e80ca35b7c5268b3580891b3b17768253.zip
Er, don't save_config() every frame... wait until the user lets go of the button.
-rw-r--r--spaghetti-monster/anduril/anduril.c7
-rw-r--r--spaghetti-monster/fsm-events.h4
2 files changed, 7 insertions, 4 deletions
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c
index 59d27e5..4daec1d 100644
--- a/spaghetti-monster/anduril/anduril.c
+++ b/spaghetti-monster/anduril/anduril.c
@@ -706,11 +706,16 @@ uint8_t lockout_state(EventPtr event, uint16_t arg) {
save_config();
return MISCHIEF_MANAGED;
}
- // 3 clicks: rotate through indicator LED modes (off mode)
+ // click, click, hold: rotate through indicator LED modes (off mode)
else if (event == EV_click3_hold) {
uint8_t mode = (arg >> 5) % 3;
indicator_led_mode = (indicator_led_mode & 0b11111100) | mode;
indicator_led(mode);
+ //save_config();
+ return MISCHIEF_MANAGED;
+ }
+ // click, click, hold, release: save indicator LED mode (off mode)
+ else if (event == EV_click3_hold_release) {
save_config();
return MISCHIEF_MANAGED;
}
diff --git a/spaghetti-monster/fsm-events.h b/spaghetti-monster/fsm-events.h
index 453ad0b..28f1b10 100644
--- a/spaghetti-monster/fsm-events.h
+++ b/spaghetti-monster/fsm-events.h
@@ -178,7 +178,6 @@ Event EV_click3_hold[] = {
A_PRESS,
A_HOLD,
0 };
-/*
Event EV_click3_hold_release[] = {
A_PRESS,
A_RELEASE,
@@ -188,7 +187,6 @@ Event EV_click3_hold_release[] = {
A_HOLD,
A_RELEASE,
0 };
- */
Event EV_click3_release[] = {
A_PRESS,
A_RELEASE,
@@ -426,7 +424,7 @@ EventPtr event_sequences[] = {
#if MAX_CLICKS >= 3
EV_click3_press,
EV_click3_hold,
- //EV_click3_hold_release,
+ 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.