aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2018-10-12 16:16:02 -0600
committerSelene ToyKeeper2018-10-12 16:16:02 -0600
commit268b2deacc7b65c7d9d2805d1e504cf94f5734ac (patch)
treed9e25702962ef9139dac925678c95b378a9d368f
parentapplied thermal target bugfix from Anduril (diff)
downloadanduril-268b2deacc7b65c7d9d2805d1e504cf94f5734ac.tar.gz
anduril-268b2deacc7b65c7d9d2805d1e504cf94f5734ac.tar.bz2
anduril-268b2deacc7b65c7d9d2805d1e504cf94f5734ac.zip
Moved "off" mode's aux LED to config to "7 clicks from off".
Diffstat (limited to '')
-rw-r--r--spaghetti-monster/anduril/anduril.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c
index 6e33610..300e32b 100644
--- a/spaghetti-monster/anduril/anduril.c
+++ b/spaghetti-monster/anduril/anduril.c
@@ -139,13 +139,20 @@
#define RAMP_LENGTH 150 // default, if not overridden in a driver cfg file
#define MAX_BIKING_LEVEL 120 // should be 127 or less
#define USE_BATTCHECK
-#ifdef USE_MUGGLE_MODE
+
+// determine the highest number of clicks to handle
+#ifdef USE_INDICATOR_LED
+#define MAX_CLICKS 7
+#elif defined(USE_MUGGLE_MODE)
#define MAX_CLICKS 6
-#define MUGGLE_FLOOR 22
-#define MUGGLE_CEILING (MAX_1x7135+20)
#else
#define MAX_CLICKS 5
#endif
+
+#if defined(USE_MUGGLE_MODE)
+#define MUGGLE_FLOOR 22
+#define MUGGLE_CEILING (MAX_1x7135+20)
+#endif
#define USE_IDLE_MODE // reduce power use while awake and no tasks are pending
#define USE_DYNAMIC_UNDERCLOCKING // cut clock speed at very low modes for better efficiency
@@ -488,6 +495,24 @@ uint8_t off_state(EventPtr event, uint16_t arg) {
return MISCHIEF_MANAGED;
}
#endif
+ #ifdef USE_INDICATOR_LED
+ // 7 clicks: change indicator LED mode
+ else if (event == EV_7clicks) {
+ uint8_t mode = (indicator_led_mode & 3) + 1;
+ #ifdef TICK_DURING_STANDBY
+ mode = mode & 3;
+ #else
+ mode = mode % 3;
+ #endif
+ #ifdef INDICATOR_LED_SKIP_LOW
+ if (mode == 1) { mode ++; }
+ #endif
+ indicator_led_mode = (indicator_led_mode & 0b11111100) | mode;
+ indicator_led(mode);
+ save_config();
+ return MISCHIEF_MANAGED;
+ }
+ #endif
return EVENT_NOT_HANDLED;
}
@@ -1198,6 +1223,7 @@ uint8_t lockout_state(EventPtr event, uint16_t arg) {
save_config();
return MISCHIEF_MANAGED;
}
+ #if 0 // old method, deprecated in favor of "7 clicks from off"
// click, click, hold: rotate through indicator LED modes (off mode)
else if (event == EV_click3_hold) {
#ifndef USE_INDICATOR_LED_WHILE_RAMPING
@@ -1230,6 +1256,7 @@ uint8_t lockout_state(EventPtr event, uint16_t arg) {
return MISCHIEF_MANAGED;
}
#endif
+ #endif
// 4 clicks: exit
else if (event == EV_4clicks) {
blink_confirm(1);
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.