diff options
| author | Selene ToyKeeper | 2022-07-29 21:21:36 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2022-07-29 21:21:36 -0600 |
| commit | 8b44161020b549771e5cbf0345388e5aaa5af01e (patch) | |
| tree | 88a080315063c85f2f716e02025b473b7046a10c | |
| parent | added Emisar D1v2 models (old FET+7135, new linear+FET, new linear-only) (diff) | |
| download | anduril-8b44161020b549771e5cbf0345388e5aaa5af01e.tar.gz anduril-8b44161020b549771e5cbf0345388e5aaa5af01e.tar.bz2 anduril-8b44161020b549771e5cbf0345388e5aaa5af01e.zip | |
allow supporting single-color and RGB side button in the same build
(new D1v2 comes in both flavors, and it's easier for everyone if
they can use the same firmware)
Also, removed lockout-abort bug on D1v2 (and DM11, I think).
Hopefully some day I'll have time to update to a newer compiler,
and then hopefully it won't have this issue any more... but for now,
it still uses a kludge to trick the compiler into working.
| -rw-r--r-- | spaghetti-monster/anduril/cfg-emisar-d1v2-7135-fet.h | 11 | ||||
| -rw-r--r-- | spaghetti-monster/anduril/cfg-emisar-d1v2-linear-fet.h | 13 | ||||
| -rw-r--r-- | spaghetti-monster/anduril/cfg-emisar-d1v2-nofet.h | 13 | ||||
| -rw-r--r-- | spaghetti-monster/anduril/cfg-noctigon-dm11-12v.h | 4 | ||||
| -rw-r--r-- | spaghetti-monster/anduril/cfg-noctigon-dm11-sbt90.h | 4 | ||||
| -rw-r--r-- | spaghetti-monster/anduril/cfg-noctigon-dm11.h | 4 | ||||
| -rw-r--r-- | spaghetti-monster/fsm-ramping.c | 9 |
7 files changed, 46 insertions, 12 deletions
diff --git a/spaghetti-monster/anduril/cfg-emisar-d1v2-7135-fet.h b/spaghetti-monster/anduril/cfg-emisar-d1v2-7135-fet.h index a448703..aa9780b 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d1v2-7135-fet.h +++ b/spaghetti-monster/anduril/cfg-emisar-d1v2-7135-fet.h @@ -6,11 +6,14 @@ #undef MODEL_NUMBER #define MODEL_NUMBER "0123" -// ... there is no separate button LED, only the RGB LEDs -#undef USE_BUTTON_LED +// some models use a simple button LED, others use RGB... +// ... so include support for both +#define USE_BUTTON_LED // the aux LEDs are in the button, so use them while main LEDs are on // (early short run had no button LEDs at all, later run uses linear+FET instead, // so it's unlikely that anyone needs this, but it doesn't hurt anything) +#define USE_AUX_RGB_LEDS +#define USE_AUX_RGB_LEDS_WHILE_ON #define USE_INDICATOR_LED_WHILE_RAMPING // safe limit ~50% power @@ -22,3 +25,7 @@ #undef THERM_FASTER_LEVEL #endif #define THERM_FASTER_LEVEL (RAMP_SIZE*9/10) // throttle back faster when high + + +// work around bizarre bug: lockout mode fails when set to solid color blinking +#define USE_K93_LOCKOUT_KLUDGE diff --git a/spaghetti-monster/anduril/cfg-emisar-d1v2-linear-fet.h b/spaghetti-monster/anduril/cfg-emisar-d1v2-linear-fet.h index e14295e..5dd5a2e 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d1v2-linear-fet.h +++ b/spaghetti-monster/anduril/cfg-emisar-d1v2-linear-fet.h @@ -6,11 +6,12 @@ #undef MODEL_NUMBER #define MODEL_NUMBER "0124" -// ... there is no separate button LED, only the RGB LEDs -#ifdef USE_BUTTON_LED -#undef USE_BUTTON_LED -#endif +// some models use a simple button LED, others use RGB... +// ... so include support for both +#define USE_BUTTON_LED // the aux LEDs are in the button, so use them while main LEDs are on +#define USE_AUX_RGB_LEDS +#define USE_AUX_RGB_LEDS_WHILE_ON #define USE_INDICATOR_LED_WHILE_RAMPING // safe limit: max regulated power @@ -22,3 +23,7 @@ #undef THERM_FASTER_LEVEL #endif #define THERM_FASTER_LEVEL (RAMP_SIZE*9/10) // throttle back faster when high + + +// work around bizarre bug: lockout mode fails when set to solid color blinking +#define USE_K93_LOCKOUT_KLUDGE diff --git a/spaghetti-monster/anduril/cfg-emisar-d1v2-nofet.h b/spaghetti-monster/anduril/cfg-emisar-d1v2-nofet.h index 081202d..1c7aec9 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d1v2-nofet.h +++ b/spaghetti-monster/anduril/cfg-emisar-d1v2-nofet.h @@ -6,13 +6,18 @@ #undef MODEL_NUMBER #define MODEL_NUMBER "0125" -// ... there is no separate button LED, only the RGB LEDs -#ifdef USE_BUTTON_LED -#undef USE_BUTTON_LED -#endif +// some models use a simple button LED, others use RGB... +// ... so include support for both +#define USE_BUTTON_LED // the aux LEDs are in the button, so use them while main LEDs are on +#define USE_AUX_RGB_LEDS +#define USE_AUX_RGB_LEDS_WHILE_ON #define USE_INDICATOR_LED_WHILE_RAMPING // safe limit: same as regular ramp #undef SIMPLE_UI_CEIL #define SIMPLE_UI_CEIL RAMP_SMOOTH_CEIL + + +// work around bizarre bug: lockout mode fails when set to solid color blinking +#define USE_K93_LOCKOUT_KLUDGE diff --git a/spaghetti-monster/anduril/cfg-noctigon-dm11-12v.h b/spaghetti-monster/anduril/cfg-noctigon-dm11-12v.h index 3e7c1d3..bd41660 100644 --- a/spaghetti-monster/anduril/cfg-noctigon-dm11-12v.h +++ b/spaghetti-monster/anduril/cfg-noctigon-dm11-12v.h @@ -72,3 +72,7 @@ // added for convenience #define USE_SOFT_FACTORY_RESET + + +// work around bizarre bug: lockout mode fails when set to solid color blinking +#define USE_K93_LOCKOUT_KLUDGE diff --git a/spaghetti-monster/anduril/cfg-noctigon-dm11-sbt90.h b/spaghetti-monster/anduril/cfg-noctigon-dm11-sbt90.h index 9a0c8b7..92c1ded 100644 --- a/spaghetti-monster/anduril/cfg-noctigon-dm11-sbt90.h +++ b/spaghetti-monster/anduril/cfg-noctigon-dm11-sbt90.h @@ -71,3 +71,7 @@ // added for convenience #define USE_SOFT_FACTORY_RESET + + +// work around bizarre bug: lockout mode fails when set to solid color blinking +#define USE_K93_LOCKOUT_KLUDGE diff --git a/spaghetti-monster/anduril/cfg-noctigon-dm11.h b/spaghetti-monster/anduril/cfg-noctigon-dm11.h index 794ae2b..4c746c9 100644 --- a/spaghetti-monster/anduril/cfg-noctigon-dm11.h +++ b/spaghetti-monster/anduril/cfg-noctigon-dm11.h @@ -71,3 +71,7 @@ // added for convenience #define USE_SOFT_FACTORY_RESET + + +// work around bizarre bug: lockout mode fails when set to solid color blinking +#define USE_K93_LOCKOUT_KLUDGE diff --git a/spaghetti-monster/fsm-ramping.c b/spaghetti-monster/fsm-ramping.c index 1667c00..63692c8 100644 --- a/spaghetti-monster/fsm-ramping.c +++ b/spaghetti-monster/fsm-ramping.c @@ -43,14 +43,19 @@ void set_level(uint8_t level) { #endif #ifdef USE_INDICATOR_LED_WHILE_RAMPING + // use side-facing aux LEDs while main LEDs are on + if (! go_to_standby) { #ifdef USE_INDICATOR_LED - if (! go_to_standby) indicator_led((level > 0) + (level > DEFAULT_LEVEL)); #endif + #ifdef USE_BUTTON_LED + button_led_set((level > 0) + (level > DEFAULT_LEVEL)); + #endif + } //if (level > MAX_1x7135) indicator_led(2); //else if (level > 0) indicator_led(1); //else if (! go_to_standby) indicator_led(0); - #else + #else // turn off front-facing aux LEDs while main LEDs are on #if defined(USE_INDICATOR_LED) || defined(USE_AUX_RGB_LEDS) if (! go_to_standby) { #ifdef USE_INDICATOR_LED |
