aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2020-09-14 16:30:47 -0600
committerSelene ToyKeeper2020-09-14 16:30:47 -0600
commit00f2b8e3aa035f437c23dc1fa3cebffe457c987b (patch)
tree27d22c868af931bda1a5fd221852d35b4e01af23
parentmerged upstream fsm branch to get fix for laggy voltage readings on FW3A (diff)
downloadanduril-00f2b8e3aa035f437c23dc1fa3cebffe457c987b.tar.gz
anduril-00f2b8e3aa035f437c23dc1fa3cebffe457c987b.tar.bz2
anduril-00f2b8e3aa035f437c23dc1fa3cebffe457c987b.zip
added "disco" mode to RGB aux LEDs (fast random colors)
(patch to aux-leds.c contributed by SammysHP as "acid" mode) (also removed RGB config for a few lights because they were just duplicating the defaults, and were redundant)
-rw-r--r--spaghetti-monster/anduril/anduril-manual.txt3
-rw-r--r--spaghetti-monster/anduril/aux-leds.c6
-rw-r--r--spaghetti-monster/anduril/aux-leds.h10
-rw-r--r--spaghetti-monster/anduril/cfg-noctigon-k1-12v.h2
-rw-r--r--spaghetti-monster/anduril/cfg-noctigon-k1-sbt90.h4
-rw-r--r--spaghetti-monster/anduril/cfg-noctigon-k1.h2
-rw-r--r--spaghetti-monster/anduril/cfg-noctigon-kr4.h3
7 files changed, 14 insertions, 16 deletions
diff --git a/spaghetti-monster/anduril/anduril-manual.txt b/spaghetti-monster/anduril/anduril-manual.txt
index 4f11719..95d4253 100644
--- a/spaghetti-monster/anduril/anduril-manual.txt
+++ b/spaghetti-monster/anduril/anduril-manual.txt
@@ -530,7 +530,8 @@ On most lights, the colors follow this sequence:
- Blue
- Purple (Blue+Red)
- White (Red+Green+Blue)
- - Rainbow (cycles through all colors)
+ - Disco (fast random colors)
+ - Rainbow (cycles through all colors in order)
- Voltage (uses color to display battery charge)
In voltage mode, the colors follow the same sequence, in the same order
diff --git a/spaghetti-monster/anduril/aux-leds.c b/spaghetti-monster/anduril/aux-leds.c
index d783797..7c0ab10 100644
--- a/spaghetti-monster/anduril/aux-leds.c
+++ b/spaghetti-monster/anduril/aux-leds.c
@@ -101,7 +101,11 @@ void rgb_led_update(uint8_t mode, uint8_t arg) {
if (color < 7) { // normal color
actual_color = pgm_read_byte(colors + color);
}
- else if (color == 7) { // rainbow
+ else if (color == 7) { // disco
+ rainbow = (rainbow + 1 + pseudo_rand() % 5) % 6;
+ actual_color = pgm_read_byte(colors + rainbow);
+ }
+ else if (color == 8) { // rainbow
uint8_t speed = 0x03; // awake speed
if (go_to_standby) speed = RGB_RAINBOW_SPEED; // asleep speed
if (0 == (arg & speed)) {
diff --git a/spaghetti-monster/anduril/aux-leds.h b/spaghetti-monster/anduril/aux-leds.h
index cb3975e..94dc3c0 100644
--- a/spaghetti-monster/anduril/aux-leds.h
+++ b/spaghetti-monster/anduril/aux-leds.h
@@ -47,14 +47,16 @@ const PROGMEM uint8_t rgb_led_colors[] = {
0b00010001, // 5: purple
0b00010101, // 6: white
};
-#define RGB_LED_NUM_COLORS 10
+// intentionally 1 higher than total modes, to make "voltage" easier to reach
+// (at Hank's request)
+#define RGB_LED_NUM_COLORS 11
#define RGB_LED_NUM_PATTERNS 4
#ifndef RGB_LED_OFF_DEFAULT
-#define RGB_LED_OFF_DEFAULT 0x18 // low, voltage
-//#define RGB_LED_OFF_DEFAULT 0x17 // low, rainbow
+#define RGB_LED_OFF_DEFAULT 0x19 // low, voltage
+//#define RGB_LED_OFF_DEFAULT 0x18 // low, rainbow
#endif
#ifndef RGB_LED_LOCKOUT_DEFAULT
-#define RGB_LED_LOCKOUT_DEFAULT 0x37 // blinking, rainbow
+#define RGB_LED_LOCKOUT_DEFAULT 0x37 // blinking, disco
#endif
#ifndef RGB_RAINBOW_SPEED
#define RGB_RAINBOW_SPEED 0x0f // change color every 16 frames
diff --git a/spaghetti-monster/anduril/cfg-noctigon-k1-12v.h b/spaghetti-monster/anduril/cfg-noctigon-k1-12v.h
index d0281c5..1a7991c 100644
--- a/spaghetti-monster/anduril/cfg-noctigon-k1-12v.h
+++ b/spaghetti-monster/anduril/cfg-noctigon-k1-12v.h
@@ -11,8 +11,6 @@
#define USE_AUX_RGB_LEDS
#define USE_AUX_RGB_LEDS_WHILE_ON
#define USE_INDICATOR_LED_WHILE_RAMPING
-#define RGB_LED_OFF_DEFAULT 0x18 // low, voltage
-#define RGB_LED_LOCKOUT_DEFAULT 0x37 // blinking, rainbow
// enable blinking aux LEDs
#define TICK_DURING_STANDBY
diff --git a/spaghetti-monster/anduril/cfg-noctigon-k1-sbt90.h b/spaghetti-monster/anduril/cfg-noctigon-k1-sbt90.h
index 0d7ad2b..99813d1 100644
--- a/spaghetti-monster/anduril/cfg-noctigon-k1-sbt90.h
+++ b/spaghetti-monster/anduril/cfg-noctigon-k1-sbt90.h
@@ -12,9 +12,7 @@
#define USE_AUX_RGB_LEDS
#define USE_AUX_RGB_LEDS_WHILE_ON
#define USE_INDICATOR_LED_WHILE_RAMPING
-#define RGB_LED_OFF_DEFAULT 0x18 // low, voltage
-#define RGB_LED_LOCKOUT_DEFAULT 0x37 // blinking, rainbow
-#define RGB_RAINBOW_SPEED 0x03 // half a second per color
+#define RGB_RAINBOW_SPEED 0x03 // half a second per color in rainbow mode
// enable blinking aux LEDs
#define TICK_DURING_STANDBY
diff --git a/spaghetti-monster/anduril/cfg-noctigon-k1.h b/spaghetti-monster/anduril/cfg-noctigon-k1.h
index 187049b..6531ecd 100644
--- a/spaghetti-monster/anduril/cfg-noctigon-k1.h
+++ b/spaghetti-monster/anduril/cfg-noctigon-k1.h
@@ -12,8 +12,6 @@
#define USE_AUX_RGB_LEDS
#define USE_AUX_RGB_LEDS_WHILE_ON
#define USE_INDICATOR_LED_WHILE_RAMPING
-#define RGB_LED_OFF_DEFAULT 0x18 // low, voltage
-#define RGB_LED_LOCKOUT_DEFAULT 0x37 // blinking, rainbow
// enable blinking aux LEDs
#define TICK_DURING_STANDBY
diff --git a/spaghetti-monster/anduril/cfg-noctigon-kr4.h b/spaghetti-monster/anduril/cfg-noctigon-kr4.h
index afc0fa9..17c3c00 100644
--- a/spaghetti-monster/anduril/cfg-noctigon-kr4.h
+++ b/spaghetti-monster/anduril/cfg-noctigon-kr4.h
@@ -16,9 +16,6 @@
#ifdef USE_INDICATOR_LED_WHILE_RAMPING
#undef USE_INDICATOR_LED_WHILE_RAMPING
#endif
-#define RGB_LED_OFF_DEFAULT 0x17 // low, rainbow
-#define RGB_LED_LOCKOUT_DEFAULT 0x37 // blinking, rainbow
-#define RGB_RAINBOW_SPEED 0x03 // half a second per color
// enable blinking aux LEDs
#define TICK_DURING_STANDBY
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.