diff options
| author | Selene ToyKeeper | 2021-01-25 00:02:10 -0700 |
|---|---|---|
| committer | Selene ToyKeeper | 2021-01-25 00:02:10 -0700 |
| commit | 0132c47f0ca6725593f9b43a4984df29f7a90cc4 (patch) | |
| tree | 9bccfe14958bee9b1fdffc1600f69c40ebe332e3 /spaghetti-monster | |
| parent | merged noctigon k9.3 branch (diff) | |
| download | anduril-0132c47f0ca6725593f9b43a4984df29f7a90cc4.tar.gz anduril-0132c47f0ca6725593f9b43a4984df29f7a90cc4.tar.bz2 anduril-0132c47f0ca6725593f9b43a4984df29f7a90cc4.zip | |
bug pseudo-fix: K9.3 lockout mode failed in blinking single-color mode
because of what appears to be compiler jank or a race condition or
some other highly unusual issue
(fixed by eating up extra clock cycles in the affected code path)
Diffstat (limited to 'spaghetti-monster')
| -rw-r--r-- | spaghetti-monster/anduril/aux-leds.c | 9 | ||||
| -rw-r--r-- | spaghetti-monster/anduril/cfg-noctigon-k9.3.h | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/spaghetti-monster/anduril/aux-leds.c b/spaghetti-monster/anduril/aux-leds.c index c819bd7..73d163e 100644 --- a/spaghetti-monster/anduril/aux-leds.c +++ b/spaghetti-monster/anduril/aux-leds.c @@ -99,6 +99,15 @@ void rgb_led_update(uint8_t mode, uint8_t arg) { const uint8_t *colors = rgb_led_colors; uint8_t actual_color = 0; if (color < 7) { // normal color + #ifdef USE_K93_LOCKOUT_KLUDGE + // FIXME: jank alert: this is dumb + // this clause does nothing; it just uses up clock cycles + // because without it, the K9.3's lockout mode fails and returns + // to "off" after ~5 to 15 seconds when configured for a blinking + // single color, even though there is no code path from lockout to + // "off", and it doesn't act like a reboot either (no boot-up blink) + rainbow = (rainbow + 1 + pseudo_rand() % 5) % 6; + #endif actual_color = pgm_read_byte(colors + color); } else if (color == 7) { // disco diff --git a/spaghetti-monster/anduril/cfg-noctigon-k9.3.h b/spaghetti-monster/anduril/cfg-noctigon-k9.3.h index 4d3d3d9..e61ea13 100644 --- a/spaghetti-monster/anduril/cfg-noctigon-k9.3.h +++ b/spaghetti-monster/anduril/cfg-noctigon-k9.3.h @@ -84,3 +84,6 @@ inline void set_level_override(uint8_t level); // for consistency with KR4 (not otherwise necessary though) #define USE_SOFT_FACTORY_RESET + +// work around bizarre bug: lockout mode fails when set to solid color blinking +#define USE_K93_LOCKOUT_KLUDGE |
