aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster
diff options
context:
space:
mode:
authorSelene ToyKeeper2023-04-25 23:57:33 -0600
committerSelene ToyKeeper2023-04-25 23:57:33 -0600
commit5c3917517c8bebdb9326ec715ed3e52ea801d695 (patch)
tree653eacfe559f720e9a1380d000ef375618b7e06f /spaghetti-monster
parentfixed bug behind K93_LOCKOUT_KLUDGE which could exit lockout in solid aux mode (diff)
downloadanduril-5c3917517c8bebdb9326ec715ed3e52ea801d695.tar.gz
anduril-5c3917517c8bebdb9326ec715ed3e52ea801d695.tar.bz2
anduril-5c3917517c8bebdb9326ec715ed3e52ea801d695.zip
put RGB aux LEDs in high mode for 3 seconds after light goes to sleep
(much easier to see the voltage this way, including post-turbo sag)
Diffstat (limited to '')
-rw-r--r--spaghetti-monster/anduril/aux-leds.c4
-rw-r--r--spaghetti-monster/anduril/aux-leds.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/spaghetti-monster/anduril/aux-leds.c b/spaghetti-monster/anduril/aux-leds.c
index c72eb70..5ac92a3 100644
--- a/spaghetti-monster/anduril/aux-leds.c
+++ b/spaghetti-monster/anduril/aux-leds.c
@@ -79,7 +79,7 @@ uint8_t voltage_to_rgb() {
// do fancy stuff with the RGB aux LEDs
// mode: 0bPPPPCCCC where PPPP is the pattern and CCCC is the color
// arg: time slice number
-void rgb_led_update(uint8_t mode, uint8_t arg) {
+void rgb_led_update(uint8_t mode, uint16_t arg) {
static uint8_t rainbow = 0; // track state of rainbow mode
static uint8_t frame = 0; // track state of animation mode
@@ -104,6 +104,8 @@ void rgb_led_update(uint8_t mode, uint8_t arg) {
// preview in blinking mode is awkward... use high instead
if ((! go_to_standby) && (pattern > 2)) { pattern = 2; }
+ // use high mode for a few seconds after initial poweroff
+ if (arg < (SLEEP_TICKS_PER_SECOND*3)) pattern = 2;
const uint8_t *colors = rgb_led_colors;
uint8_t actual_color = 0;
diff --git a/spaghetti-monster/anduril/aux-leds.h b/spaghetti-monster/anduril/aux-leds.h
index 1938557..2e656dc 100644
--- a/spaghetti-monster/anduril/aux-leds.h
+++ b/spaghetti-monster/anduril/aux-leds.h
@@ -8,7 +8,7 @@ void indicator_led_update(uint8_t mode, uint8_t tick);
#endif
#if defined(USE_AUX_RGB_LEDS) && defined(TICK_DURING_STANDBY)
uint8_t setting_rgb_mode_now = 0;
-void rgb_led_update(uint8_t mode, uint8_t arg);
+void rgb_led_update(uint8_t mode, uint16_t arg);
void rgb_led_voltage_readout(uint8_t bright);
/*
* 0: R