From a04399b7b432f59db3ff397ace09613f582fd7b6 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Tue, 13 Apr 2021 23:33:20 -0600 Subject: config updates for Hank (Emisar / Noctigon): - use cycling rainbow mode by default on lights with RGB LEDs (instead of voltage, because it's better for impressing new users) - use 2C turbo instead of 2C ceiling (Anduril 1 style instead of Anduril 2 style) also some other minor housekeeping... - make all K1 models use consistent rainbow cycling speed - enable auto-lock and manual memory timer on Emisar D1v2 - remove redundant RGB config on Lume1 (it had incorrect comments anyway) --- spaghetti-monster/anduril/cfg-emisar-d18.h | 1 + spaghetti-monster/anduril/cfg-emisar-d1v2.h | 2 -- spaghetti-monster/anduril/cfg-emisar-d4.h | 1 + spaghetti-monster/anduril/cfg-emisar-d4s.h | 1 + spaghetti-monster/anduril/cfg-emisar-d4sv2.h | 1 + spaghetti-monster/anduril/cfg-emisar-d4v2.h | 1 + spaghetti-monster/anduril/cfg-fw3x-lume1.h | 2 -- spaghetti-monster/anduril/cfg-noctigon-k1-12v.h | 1 + spaghetti-monster/anduril/cfg-noctigon-k1-sbt90.h | 4 ++-- spaghetti-monster/anduril/cfg-noctigon-k1.h | 1 + spaghetti-monster/anduril/cfg-noctigon-k9.3.h | 2 +- spaghetti-monster/anduril/cfg-noctigon-kr4.h | 1 + 12 files changed, 11 insertions(+), 7 deletions(-) diff --git a/spaghetti-monster/anduril/cfg-emisar-d18.h b/spaghetti-monster/anduril/cfg-emisar-d18.h index 6aaa693..2147dc5 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d18.h +++ b/spaghetti-monster/anduril/cfg-emisar-d18.h @@ -1,6 +1,7 @@ // Emisar D18 (FET+13+1) config options for Anduril #define MODEL_NUMBER "0141" #include "hwdef-Emisar_D18.h" +#include "hank-cfg.h" // level_calc.py seventh 3 150 7135 1 1.4 117.99 7135 6 1 1706.86 FET 3 10 13000 // (designed to make 1x hit at level 50, and Nx hit at level 100) diff --git a/spaghetti-monster/anduril/cfg-emisar-d1v2.h b/spaghetti-monster/anduril/cfg-emisar-d1v2.h index c2815fd..48a3ef0 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d1v2.h +++ b/spaghetti-monster/anduril/cfg-emisar-d1v2.h @@ -9,8 +9,6 @@ #undef USE_AUX_RGB_LEDS // ... and no button LED #undef USE_BUTTON_LED -// no aux LEDs means no need for sleep ticks -#undef TICK_DURING_STANDBY // safe limit ~50% power #undef SIMPLE_UI_CEIL diff --git a/spaghetti-monster/anduril/cfg-emisar-d4.h b/spaghetti-monster/anduril/cfg-emisar-d4.h index caabb0e..b21c6a3 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d4.h +++ b/spaghetti-monster/anduril/cfg-emisar-d4.h @@ -1,6 +1,7 @@ // Emisar D4 config options for Anduril #define MODEL_NUMBER "0111" #include "hwdef-Emisar_D4.h" +#include "hank-cfg.h" // ../../bin/level_calc.py 1 65 7135 1 0.8 150 // ... mixed with this: diff --git a/spaghetti-monster/anduril/cfg-emisar-d4s.h b/spaghetti-monster/anduril/cfg-emisar-d4s.h index fdab906..ef7534b 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d4s.h +++ b/spaghetti-monster/anduril/cfg-emisar-d4s.h @@ -1,6 +1,7 @@ // Emisar D4S config options for Anduril #define MODEL_NUMBER "0131" #include "hwdef-Emisar_D4S.h" +#include "hank-cfg.h" // the button lights up #define USE_INDICATOR_LED diff --git a/spaghetti-monster/anduril/cfg-emisar-d4sv2.h b/spaghetti-monster/anduril/cfg-emisar-d4sv2.h index ad6de03..df49532 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d4sv2.h +++ b/spaghetti-monster/anduril/cfg-emisar-d4sv2.h @@ -1,6 +1,7 @@ // Emisar D4S V2 config options for Anduril #define MODEL_NUMBER "0133" #include "hwdef-Emisar_D4Sv2.h" +#include "hank-cfg.h" // ATTINY: 1634 // this light has three aux LED channels: R, G, B diff --git a/spaghetti-monster/anduril/cfg-emisar-d4v2.h b/spaghetti-monster/anduril/cfg-emisar-d4v2.h index 6e389aa..9759c0e 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d4v2.h +++ b/spaghetti-monster/anduril/cfg-emisar-d4v2.h @@ -1,6 +1,7 @@ // Emisar D4 config options for Anduril #define MODEL_NUMBER "0113" #include "hwdef-Emisar_D4v2.h" +#include "hank-cfg.h" // ATTINY: 1634 // this light has three aux LED channels: R, G, B diff --git a/spaghetti-monster/anduril/cfg-fw3x-lume1.h b/spaghetti-monster/anduril/cfg-fw3x-lume1.h index 75853ec..818fb9d 100644 --- a/spaghetti-monster/anduril/cfg-fw3x-lume1.h +++ b/spaghetti-monster/anduril/cfg-fw3x-lume1.h @@ -27,8 +27,6 @@ #ifdef USE_INDICATOR_LED_WHILE_RAMPING #undef USE_INDICATOR_LED_WHILE_RAMPING #endif -#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-12v.h b/spaghetti-monster/anduril/cfg-noctigon-k1-12v.h index b1a12eb..25add17 100644 --- a/spaghetti-monster/anduril/cfg-noctigon-k1-12v.h +++ b/spaghetti-monster/anduril/cfg-noctigon-k1-12v.h @@ -1,6 +1,7 @@ // Noctigon K1 12V config options for Anduril #define MODEL_NUMBER "0253" #include "hwdef-Noctigon_K1-12V.h" +#include "hank-cfg.h" // ATTINY: 1634 // Most K1 lights can run hotter than default, but the 12V model diff --git a/spaghetti-monster/anduril/cfg-noctigon-k1-sbt90.h b/spaghetti-monster/anduril/cfg-noctigon-k1-sbt90.h index 99813d1..ca6a9d1 100644 --- a/spaghetti-monster/anduril/cfg-noctigon-k1-sbt90.h +++ b/spaghetti-monster/anduril/cfg-noctigon-k1-sbt90.h @@ -2,6 +2,7 @@ // (is a K1 host with a KR4-like driver and a really high-powered LED) #define MODEL_NUMBER "0252" #include "hwdef-Noctigon_K1-SBT90.h" +#include "hank-cfg.h" // ATTINY: 1634 // this light can safely run a bit hotter than most @@ -12,7 +13,6 @@ #define USE_AUX_RGB_LEDS #define USE_AUX_RGB_LEDS_WHILE_ON #define USE_INDICATOR_LED_WHILE_RAMPING -#define RGB_RAINBOW_SPEED 0x03 // half a second per color in rainbow mode // enable blinking aux LEDs #define TICK_DURING_STANDBY @@ -52,7 +52,7 @@ //#define THERM_NEXT_WARNING_THRESHOLD 16 // accumulate less error before adjusting //#define THERM_RESPONSE_MAGNITUDE 128 // bigger adjustments -// slow down party strobe; this driver can't pulse for 1ms or less +// normal party strobe speed; this driver can pulse very quickly //#define PARTY_STROBE_ONTIME 2 #define THERM_CAL_OFFSET 5 diff --git a/spaghetti-monster/anduril/cfg-noctigon-k1.h b/spaghetti-monster/anduril/cfg-noctigon-k1.h index 6531ecd..0baafc0 100644 --- a/spaghetti-monster/anduril/cfg-noctigon-k1.h +++ b/spaghetti-monster/anduril/cfg-noctigon-k1.h @@ -2,6 +2,7 @@ #define MODEL_NUMBER "0251" // (originally known as Emisar D1S v2) #include "hwdef-Noctigon_K1.h" +#include "hank-cfg.h" // ATTINY: 1634 // this light can safely run a bit hotter than most diff --git a/spaghetti-monster/anduril/cfg-noctigon-k9.3.h b/spaghetti-monster/anduril/cfg-noctigon-k9.3.h index e61ea13..4ae859a 100644 --- a/spaghetti-monster/anduril/cfg-noctigon-k9.3.h +++ b/spaghetti-monster/anduril/cfg-noctigon-k9.3.h @@ -1,6 +1,7 @@ // Noctigon K9.3 config options for Anduril #define MODEL_NUMBER "0261" #include "hwdef-Noctigon_K9.3.h" +#include "hank-cfg.h" // ATTINY: 1634 // this model requires some special code #define OVERRIDES_FILE cfg-noctigon-k9.3.c @@ -11,7 +12,6 @@ inline void set_level_override(uint8_t level); // this light has three aux LED channels: R, G, B #define USE_AUX_RGB_LEDS -#define RGB_LED_OFF_DEFAULT 0x18 // low, rainbow // the aux LEDs are front-facing, so turn them off while main LEDs are on //#define USE_AUX_RGB_LEDS_WHILE_ON // it also has an independent LED in the button diff --git a/spaghetti-monster/anduril/cfg-noctigon-kr4.h b/spaghetti-monster/anduril/cfg-noctigon-kr4.h index 17c3c00..eea6a07 100644 --- a/spaghetti-monster/anduril/cfg-noctigon-kr4.h +++ b/spaghetti-monster/anduril/cfg-noctigon-kr4.h @@ -2,6 +2,7 @@ // (and Emisar D4v2.5, which uses KR4 driver plus a button LED) #define MODEL_NUMBER "0211" #include "hwdef-Noctigon_KR4.h" +#include "hank-cfg.h" // ATTINY: 1634 // this light has three aux LED channels: R, G, B -- cgit v1.2.3 From 8d10fc39a2ce9c16b00b8929e25cf03553af4a16 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Wed, 14 Apr 2021 00:09:23 -0600 Subject: aux LED config cleaning... - use fancy blinking mode by default (define USE_OLD_BLINKING_INDICATOR if old slow mode is wanted) - remove TICK_DURING_STANDBY from all cfg-*.h files because it's enabled automatically by other features anyway (autolock, memory timer) - remove STANDBY_TICK_SPEED from cfg-*.h because all the values matched the default anyway so it was redundant - set rot66 button LED to high+blinking instead of high+off (it was only "off" because it ran out of space, and that was resolved) - enabled fancier indicator by default on fireflies-ui and rampingiosv3, since its other #define clauses were removed (not sure if those older UIs still compile, but if so, it's worth at least trying not to break it) --- spaghetti-monster/anduril/aux-leds.c | 19 ++++++++++--------- spaghetti-monster/anduril/aux-leds.h | 2 ++ spaghetti-monster/anduril/cfg-blf-gt-mini.h | 2 -- spaghetti-monster/anduril/cfg-blf-gt.h | 2 -- spaghetti-monster/anduril/cfg-blf-lantern-t1616.h | 4 ---- spaghetti-monster/anduril/cfg-blf-lantern.h | 4 ---- spaghetti-monster/anduril/cfg-blf-q8-t1616.h | 4 ---- spaghetti-monster/anduril/cfg-blf-q8.h | 4 ---- spaghetti-monster/anduril/cfg-emisar-d4s.h | 4 ---- spaghetti-monster/anduril/cfg-emisar-d4sv2.h | 5 ----- spaghetti-monster/anduril/cfg-emisar-d4v2.h | 5 ----- spaghetti-monster/anduril/cfg-ff-pl47.h | 8 -------- spaghetti-monster/anduril/cfg-ff-pl47g2.h | 5 ----- spaghetti-monster/anduril/cfg-ff-rot66.h | 10 +--------- spaghetti-monster/anduril/cfg-ff-rot66g2.h | 4 ---- spaghetti-monster/anduril/cfg-fw3x-lume1.h | 6 ------ spaghetti-monster/anduril/cfg-gchart-fet1-t1616.h | 4 ---- spaghetti-monster/anduril/cfg-mateminco-mf01-mini.h | 4 ---- spaghetti-monster/anduril/cfg-mateminco-mf01s.h | 4 ---- spaghetti-monster/anduril/cfg-noctigon-k1-12v.h | 4 ---- spaghetti-monster/anduril/cfg-noctigon-k1-sbt90.h | 4 ---- spaghetti-monster/anduril/cfg-noctigon-k1.h | 4 ---- spaghetti-monster/anduril/cfg-noctigon-k9.3.h | 4 ---- spaghetti-monster/anduril/cfg-noctigon-kr4.h | 4 ---- spaghetti-monster/fireflies-ui/fireflies-ui.c | 1 + spaghetti-monster/rampingios/rampingiosv3.c | 1 + 26 files changed, 15 insertions(+), 107 deletions(-) diff --git a/spaghetti-monster/anduril/aux-leds.c b/spaghetti-monster/anduril/aux-leds.c index 73d163e..3195fdc 100644 --- a/spaghetti-monster/anduril/aux-leds.c +++ b/spaghetti-monster/anduril/aux-leds.c @@ -29,15 +29,9 @@ void indicator_blink(uint8_t arg) { // turn off aux LEDs when battery is empty if (voltage < VOLTAGE_LOW) { indicator_led(0); return; } - #ifdef USE_FANCIER_BLINKING_INDICATOR - - // fancy blink, set off/low/high levels here: - static const uint8_t seq[] = {0, 1, 2, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0}; - indicator_led(seq[arg & 15]); - - #else // basic blink, 1/8th duty cycle + #ifdef USE_OLD_BLINKING_INDICATOR + // basic blink, 1/8th duty cycle if (! (arg & 7)) { indicator_led(2); } @@ -45,7 +39,14 @@ void indicator_blink(uint8_t arg) { indicator_led(0); } - #endif + #else + + // fancy blink, set off/low/high levels here: + static const uint8_t seq[] = {0, 1, 2, 1, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0}; + indicator_led(seq[arg & 15]); + + #endif // ifdef USE_OLD_BLINKING_INDICATOR } #endif diff --git a/spaghetti-monster/anduril/aux-leds.h b/spaghetti-monster/anduril/aux-leds.h index 94dc3c0..664cbf1 100644 --- a/spaghetti-monster/anduril/aux-leds.h +++ b/spaghetti-monster/anduril/aux-leds.h @@ -65,6 +65,8 @@ uint8_t rgb_led_off_mode = RGB_LED_OFF_DEFAULT; uint8_t rgb_led_lockout_mode = RGB_LED_LOCKOUT_DEFAULT; #endif +//#define USE_OLD_BLINKING_INDICATOR +//#define USE_FANCIER_BLINKING_INDICATOR #ifdef USE_INDICATOR_LED // bits 2-3 control lockout mode // bits 0-1 control "off" mode diff --git a/spaghetti-monster/anduril/cfg-blf-gt-mini.h b/spaghetti-monster/anduril/cfg-blf-gt-mini.h index 45dfe36..af16f2c 100644 --- a/spaghetti-monster/anduril/cfg-blf-gt-mini.h +++ b/spaghetti-monster/anduril/cfg-blf-gt-mini.h @@ -9,6 +9,4 @@ #define USE_INDICATOR_LED // the button is visible while main LEDs are on #define USE_INDICATOR_LED_WHILE_RAMPING -// enable blinking indicator LED while off -#define TICK_DURING_STANDBY diff --git a/spaghetti-monster/anduril/cfg-blf-gt.h b/spaghetti-monster/anduril/cfg-blf-gt.h index 061685c..7f880dd 100644 --- a/spaghetti-monster/anduril/cfg-blf-gt.h +++ b/spaghetti-monster/anduril/cfg-blf-gt.h @@ -6,8 +6,6 @@ #define USE_INDICATOR_LED // the button is visible while main LEDs are on #define USE_INDICATOR_LED_WHILE_RAMPING -// enable blinking indicator LED while off -#define TICK_DURING_STANDBY // don't blink during ramp, it's irrelevant and annoying on this light #undef BLINK_AT_RAMP_CEIL diff --git a/spaghetti-monster/anduril/cfg-blf-lantern-t1616.h b/spaghetti-monster/anduril/cfg-blf-lantern-t1616.h index d602641..51c3d6a 100644 --- a/spaghetti-monster/anduril/cfg-blf-lantern-t1616.h +++ b/spaghetti-monster/anduril/cfg-blf-lantern-t1616.h @@ -13,10 +13,6 @@ #define USE_INDICATOR_LED // the button is visible while main LEDs are on #define USE_INDICATOR_LED_WHILE_RAMPING -// enable blinking indicator LED while off -#define TICK_DURING_STANDBY -#define STANDBY_TICK_SPEED 3 // every 0.128 s -#define USE_FANCIER_BLINKING_INDICATOR // off mode: high (2) // lockout: blinking (3) #define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 2) diff --git a/spaghetti-monster/anduril/cfg-blf-lantern.h b/spaghetti-monster/anduril/cfg-blf-lantern.h index 6be8ec7..28c7dbb 100644 --- a/spaghetti-monster/anduril/cfg-blf-lantern.h +++ b/spaghetti-monster/anduril/cfg-blf-lantern.h @@ -16,10 +16,6 @@ #define USE_INDICATOR_LED // the button is visible while main LEDs are on #define USE_INDICATOR_LED_WHILE_RAMPING -// enable blinking indicator LED while off -#define TICK_DURING_STANDBY -#define STANDBY_TICK_SPEED 3 // every 0.128 s -#define USE_FANCIER_BLINKING_INDICATOR // off mode: high (2) // lockout: blinking (3) #define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 2) diff --git a/spaghetti-monster/anduril/cfg-blf-q8-t1616.h b/spaghetti-monster/anduril/cfg-blf-q8-t1616.h index 73702a9..002e8e3 100644 --- a/spaghetti-monster/anduril/cfg-blf-q8-t1616.h +++ b/spaghetti-monster/anduril/cfg-blf-q8-t1616.h @@ -7,10 +7,6 @@ #define USE_INDICATOR_LED // the button is visible while main LEDs are on #define USE_INDICATOR_LED_WHILE_RAMPING -// enable blinking indicator LED while off -#define TICK_DURING_STANDBY -#define STANDBY_TICK_SPEED 3 // every 0.128 s -#define USE_FANCIER_BLINKING_INDICATOR // off mode: high (2) // lockout: blinking (3) #define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 2) diff --git a/spaghetti-monster/anduril/cfg-blf-q8.h b/spaghetti-monster/anduril/cfg-blf-q8.h index 408c305..d4243ee 100644 --- a/spaghetti-monster/anduril/cfg-blf-q8.h +++ b/spaghetti-monster/anduril/cfg-blf-q8.h @@ -6,10 +6,6 @@ #define USE_INDICATOR_LED // the button is visible while main LEDs are on #define USE_INDICATOR_LED_WHILE_RAMPING -// enable blinking indicator LED while off -#define TICK_DURING_STANDBY -#define STANDBY_TICK_SPEED 3 // every 0.128 s -#define USE_FANCIER_BLINKING_INDICATOR // off mode: high (2) // lockout: blinking (3) #define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 2) diff --git a/spaghetti-monster/anduril/cfg-emisar-d4s.h b/spaghetti-monster/anduril/cfg-emisar-d4s.h index ef7534b..f224377 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d4s.h +++ b/spaghetti-monster/anduril/cfg-emisar-d4s.h @@ -9,10 +9,6 @@ #ifdef USE_INDICATOR_LED_WHILE_RAMPING #undef USE_INDICATOR_LED_WHILE_RAMPING #endif -// enable blinking indicator LED while off -#define TICK_DURING_STANDBY -#define STANDBY_TICK_SPEED 3 // every 0.128 s -#define USE_FANCIER_BLINKING_INDICATOR #ifdef RAMP_LENGTH #undef RAMP_LENGTH diff --git a/spaghetti-monster/anduril/cfg-emisar-d4sv2.h b/spaghetti-monster/anduril/cfg-emisar-d4sv2.h index df49532..5f18fbc 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d4sv2.h +++ b/spaghetti-monster/anduril/cfg-emisar-d4sv2.h @@ -10,11 +10,6 @@ #ifdef USE_INDICATOR_LED_WHILE_RAMPING #undef USE_INDICATOR_LED_WHILE_RAMPING #endif -// enable blinking aux LEDs -#define TICK_DURING_STANDBY -#define STANDBY_TICK_SPEED 3 // every 0.128 s -//#define STANDBY_TICK_SPEED 4 // every 0.256 s -//#define STANDBY_TICK_SPEED 5 // every 0.512 s // 1x7135 + 3x7135 + FET diff --git a/spaghetti-monster/anduril/cfg-emisar-d4v2.h b/spaghetti-monster/anduril/cfg-emisar-d4v2.h index 9759c0e..4121465 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d4v2.h +++ b/spaghetti-monster/anduril/cfg-emisar-d4v2.h @@ -14,11 +14,6 @@ #ifdef USE_INDICATOR_LED_WHILE_RAMPING #undef USE_INDICATOR_LED_WHILE_RAMPING #endif -// enable blinking aux LEDs -#define TICK_DURING_STANDBY -#define STANDBY_TICK_SPEED 3 // every 0.128 s -//#define STANDBY_TICK_SPEED 4 // every 0.256 s -//#define STANDBY_TICK_SPEED 5 // every 0.512 s // copied from original D4, since it's also a FET+1 and has the same host diff --git a/spaghetti-monster/anduril/cfg-ff-pl47.h b/spaghetti-monster/anduril/cfg-ff-pl47.h index 1bb6a2f..1d46801 100644 --- a/spaghetti-monster/anduril/cfg-ff-pl47.h +++ b/spaghetti-monster/anduril/cfg-ff-pl47.h @@ -9,10 +9,7 @@ #undef USE_INDICATOR_LED_WHILE_RAMPING #endif //#define USE_INDICATOR_LED_WHILE_RAMPING -// enable blinking indicator LED while off? -#define TICK_DURING_STANDBY -// If TICK_DURING_STANDBY is enabled... // off mode: high (2) // lockout: blinking (3) #define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 2) @@ -22,11 +19,6 @@ // Fireflies wants to skip aux LED mode 1 (low) #define INDICATOR_LED_SKIP_LOW -// ... or if TICK_DURING_STANDBY is turned off: -// off mode: high (2) -// lockout: off (0) -//#define INDICATOR_LED_DEFAULT_MODE ((0<<2) + 2) - #define RAMP_LENGTH 150 diff --git a/spaghetti-monster/anduril/cfg-ff-pl47g2.h b/spaghetti-monster/anduril/cfg-ff-pl47g2.h index 7e63ec3..8d80555 100644 --- a/spaghetti-monster/anduril/cfg-ff-pl47g2.h +++ b/spaghetti-monster/anduril/cfg-ff-pl47g2.h @@ -8,12 +8,7 @@ #ifdef USE_INDICATOR_LED_WHILE_RAMPING #undef USE_INDICATOR_LED_WHILE_RAMPING #endif -// enable blinking indicator LED while off? -#define TICK_DURING_STANDBY -#define STANDBY_TICK_SPEED 3 // every 0.128 s -#define USE_FANCIER_BLINKING_INDICATOR -// If TICK_DURING_STANDBY is enabled... // off mode: low (1) // lockout: blinking (3) #define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 1) diff --git a/spaghetti-monster/anduril/cfg-ff-rot66.h b/spaghetti-monster/anduril/cfg-ff-rot66.h index 9922681..652c98b 100644 --- a/spaghetti-monster/anduril/cfg-ff-rot66.h +++ b/spaghetti-monster/anduril/cfg-ff-rot66.h @@ -6,18 +6,10 @@ #define USE_INDICATOR_LED // the button is visible while main LEDs are on #define USE_INDICATOR_LED_WHILE_RAMPING -// enable blinking indicator LED while off? -//#define TICK_DURING_STANDBY -// If TICK_DURING_STANDBY is enabled... // off mode: high (2) // lockout: blinking (3) -//#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 2) - -// ... or if TICK_DURING_STANDBY is turned off: -// off mode: high (2) -// lockout: off (0) -#define INDICATOR_LED_DEFAULT_MODE ((0<<2) + 2) +#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 2) // driver is a FET+N+1, diff --git a/spaghetti-monster/anduril/cfg-ff-rot66g2.h b/spaghetti-monster/anduril/cfg-ff-rot66g2.h index 9a70498..9737cc4 100644 --- a/spaghetti-monster/anduril/cfg-ff-rot66g2.h +++ b/spaghetti-monster/anduril/cfg-ff-rot66g2.h @@ -7,10 +7,6 @@ #ifdef INDICATOR_LED_SKIP_LOW #undef INDICATOR_LED_SKIP_LOW #endif -// enable blinking indicator LED while off -#define TICK_DURING_STANDBY -#define STANDBY_TICK_SPEED 3 // every 0.128 s -#define USE_FANCIER_BLINKING_INDICATOR // lockout: blinking (3), off: low (1) #ifdef INDICATOR_LED_DEFAULT_MODE diff --git a/spaghetti-monster/anduril/cfg-fw3x-lume1.h b/spaghetti-monster/anduril/cfg-fw3x-lume1.h index 818fb9d..2f90920 100644 --- a/spaghetti-monster/anduril/cfg-fw3x-lume1.h +++ b/spaghetti-monster/anduril/cfg-fw3x-lume1.h @@ -28,12 +28,6 @@ #undef USE_INDICATOR_LED_WHILE_RAMPING #endif -// enable blinking aux LEDs -#define TICK_DURING_STANDBY -#define STANDBY_TICK_SPEED 3 // every 0.128 s -//#define STANDBY_TICK_SPEED 4 // every 0.256 s -//#define STANDBY_TICK_SPEED 5 // every 0.512 s - // ../../bin/level_calc.py cube 1 149 7135 0 0.5 1000, with 0 appended to the end. // for FET PWM (PWM2), all values are 0, except for last value of 1023 // (with max_pwm set to 1023) diff --git a/spaghetti-monster/anduril/cfg-gchart-fet1-t1616.h b/spaghetti-monster/anduril/cfg-gchart-fet1-t1616.h index 101f25a..192307e 100644 --- a/spaghetti-monster/anduril/cfg-gchart-fet1-t1616.h +++ b/spaghetti-monster/anduril/cfg-gchart-fet1-t1616.h @@ -7,10 +7,6 @@ #define USE_INDICATOR_LED // the button is visible while main LEDs are on #define USE_INDICATOR_LED_WHILE_RAMPING -// enable blinking indicator LED while off -#define TICK_DURING_STANDBY -#define STANDBY_TICK_SPEED 3 // every 0.128 s -#define USE_FANCIER_BLINKING_INDICATOR // off mode: low (1) // lockout: blinking (3) #define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 1) diff --git a/spaghetti-monster/anduril/cfg-mateminco-mf01-mini.h b/spaghetti-monster/anduril/cfg-mateminco-mf01-mini.h index c66525c..de5da88 100644 --- a/spaghetti-monster/anduril/cfg-mateminco-mf01-mini.h +++ b/spaghetti-monster/anduril/cfg-mateminco-mf01-mini.h @@ -7,10 +7,6 @@ //#define INDICATOR_LED_SKIP_LOW // low mode doesn't work on this driver // the button is visible while main LEDs are on //#define USE_INDICATOR_LED_WHILE_RAMPING -// enable blinking indicator LED while off -#define TICK_DURING_STANDBY -#define STANDBY_TICK_SPEED 3 // every 0.128 s -#define USE_FANCIER_BLINKING_INDICATOR // off mode: low (1) // lockout: blinking (3) #define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 1) diff --git a/spaghetti-monster/anduril/cfg-mateminco-mf01s.h b/spaghetti-monster/anduril/cfg-mateminco-mf01s.h index 9a8b641..b1f3b6e 100644 --- a/spaghetti-monster/anduril/cfg-mateminco-mf01s.h +++ b/spaghetti-monster/anduril/cfg-mateminco-mf01s.h @@ -6,10 +6,6 @@ #define USE_INDICATOR_LED // the button is visible while main LEDs are on //#define USE_INDICATOR_LED_WHILE_RAMPING -// enable blinking indicator LED while off -#define TICK_DURING_STANDBY -#define STANDBY_TICK_SPEED 3 // every 0.128 s -#define USE_FANCIER_BLINKING_INDICATOR // off mode: low (1) // lockout: blinking (3) #define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 1) diff --git a/spaghetti-monster/anduril/cfg-noctigon-k1-12v.h b/spaghetti-monster/anduril/cfg-noctigon-k1-12v.h index 25add17..7f8f4cf 100644 --- a/spaghetti-monster/anduril/cfg-noctigon-k1-12v.h +++ b/spaghetti-monster/anduril/cfg-noctigon-k1-12v.h @@ -17,10 +17,6 @@ #define USE_AUX_RGB_LEDS_WHILE_ON #define USE_INDICATOR_LED_WHILE_RAMPING -// enable blinking aux LEDs -#define TICK_DURING_STANDBY -#define STANDBY_TICK_SPEED 3 // every 0.128 s - // level_calc.py cube 1 150 7135 0 4 1300 // (with max_pwm set to 1023) diff --git a/spaghetti-monster/anduril/cfg-noctigon-k1-sbt90.h b/spaghetti-monster/anduril/cfg-noctigon-k1-sbt90.h index ca6a9d1..9207dbc 100644 --- a/spaghetti-monster/anduril/cfg-noctigon-k1-sbt90.h +++ b/spaghetti-monster/anduril/cfg-noctigon-k1-sbt90.h @@ -14,10 +14,6 @@ #define USE_AUX_RGB_LEDS_WHILE_ON #define USE_INDICATOR_LED_WHILE_RAMPING -// enable blinking aux LEDs -#define TICK_DURING_STANDBY -#define STANDBY_TICK_SPEED 3 // every 0.128 s - // brightness: // 0/1023: 0.35 lm diff --git a/spaghetti-monster/anduril/cfg-noctigon-k1.h b/spaghetti-monster/anduril/cfg-noctigon-k1.h index 0baafc0..fb2a89c 100644 --- a/spaghetti-monster/anduril/cfg-noctigon-k1.h +++ b/spaghetti-monster/anduril/cfg-noctigon-k1.h @@ -14,10 +14,6 @@ #define USE_AUX_RGB_LEDS_WHILE_ON #define USE_INDICATOR_LED_WHILE_RAMPING -// enable blinking aux LEDs -#define TICK_DURING_STANDBY -#define STANDBY_TICK_SPEED 3 // every 0.128 s - // ../../bin/level_calc.py cube 1 150 7135 1 4 1300 // (with max_pwm set to 1023) diff --git a/spaghetti-monster/anduril/cfg-noctigon-k9.3.h b/spaghetti-monster/anduril/cfg-noctigon-k9.3.h index 4ae859a..f3a6cdd 100644 --- a/spaghetti-monster/anduril/cfg-noctigon-k9.3.h +++ b/spaghetti-monster/anduril/cfg-noctigon-k9.3.h @@ -23,10 +23,6 @@ inline void set_level_override(uint8_t level); #undef USE_INDICATOR_LED_WHILE_RAMPING #endif -// enable blinking aux LEDs -#define TICK_DURING_STANDBY -#define STANDBY_TICK_SPEED 3 // every 0.128 s - // has two channels of independent LEDs #define USE_TINT_RAMPING // ... but it doesn't make sense to ramp between; only toggle diff --git a/spaghetti-monster/anduril/cfg-noctigon-kr4.h b/spaghetti-monster/anduril/cfg-noctigon-kr4.h index eea6a07..82b8df5 100644 --- a/spaghetti-monster/anduril/cfg-noctigon-kr4.h +++ b/spaghetti-monster/anduril/cfg-noctigon-kr4.h @@ -18,10 +18,6 @@ #undef USE_INDICATOR_LED_WHILE_RAMPING #endif -// enable blinking aux LEDs -#define TICK_DURING_STANDBY -#define STANDBY_TICK_SPEED 3 // every 0.128 s - // brightness w/ SST-20 4000K LEDs: // 0/1023: 0.35 lm diff --git a/spaghetti-monster/fireflies-ui/fireflies-ui.c b/spaghetti-monster/fireflies-ui/fireflies-ui.c index 2c3e60b..93a3180 100644 --- a/spaghetti-monster/fireflies-ui/fireflies-ui.c +++ b/spaghetti-monster/fireflies-ui/fireflies-ui.c @@ -2107,6 +2107,7 @@ void blip() { #if defined(USE_INDICATOR_LED) && defined(TICK_DURING_STANDBY) // beacon-like mode for the indicator LED void indicator_blink(uint8_t arg) { + #define USE_FANCIER_BLINKING_INDICATOR #ifdef USE_FANCIER_BLINKING_INDICATOR // fancy blink, set off/low/high levels here: diff --git a/spaghetti-monster/rampingios/rampingiosv3.c b/spaghetti-monster/rampingios/rampingiosv3.c index 7f03e77..7b6baee 100644 --- a/spaghetti-monster/rampingios/rampingiosv3.c +++ b/spaghetti-monster/rampingios/rampingiosv3.c @@ -1106,6 +1106,7 @@ void blink_confirm(uint8_t num) { #if defined(USE_INDICATOR_LED) && defined(TICK_DURING_STANDBY) // beacon-like mode for the indicator LED void indicator_blink(uint8_t arg) { + #define USE_FANCIER_BLINKING_INDICATOR #ifdef USE_FANCIER_BLINKING_INDICATOR // fancy blink, set off/low/high levels here: -- cgit v1.2.3 From b32c2d8abc050ff404e824051158384eeb6ec437 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Fri, 7 May 2021 17:04:27 -0600 Subject: made manual memory remember tint too, not just brightness --- spaghetti-monster/anduril/load-save-config-fsm.h | 13 +++++++----- spaghetti-monster/anduril/load-save-config.c | 26 +++++++++++++++--------- spaghetti-monster/anduril/off-mode.c | 4 ++-- spaghetti-monster/anduril/ramp-mode.c | 3 +++ spaghetti-monster/anduril/tint-ramping.h | 4 ++++ 5 files changed, 33 insertions(+), 17 deletions(-) diff --git a/spaghetti-monster/anduril/load-save-config-fsm.h b/spaghetti-monster/anduril/load-save-config-fsm.h index 885fb72..9d3dd86 100644 --- a/spaghetti-monster/anduril/load-save-config-fsm.h +++ b/spaghetti-monster/anduril/load-save-config-fsm.h @@ -32,13 +32,16 @@ typedef enum { ramp_discrete_steps_e, #endif #ifdef USE_MANUAL_MEMORY - manual_memory_e, - #ifdef USE_MANUAL_MEMORY_TIMER - manual_memory_timer_e, - #endif + manual_memory_e, + #ifdef USE_MANUAL_MEMORY_TIMER + manual_memory_timer_e, + #endif + #ifdef USE_TINT_RAMPING + manual_memory_tint_e, + #endif #endif #ifdef USE_TINT_RAMPING - tint_e, + tint_e, #endif #ifdef USE_STROBE_STATE strobe_type_e, diff --git a/spaghetti-monster/anduril/load-save-config.c b/spaghetti-monster/anduril/load-save-config.c index 2880c6d..3823521 100644 --- a/spaghetti-monster/anduril/load-save-config.c +++ b/spaghetti-monster/anduril/load-save-config.c @@ -34,13 +34,16 @@ void load_config() { ramp_stepss[1] = eeprom[ramp_discrete_steps_e]; #endif #ifdef USE_MANUAL_MEMORY - manual_memory = eeprom[manual_memory_e]; - #ifdef USE_MANUAL_MEMORY_TIMER - manual_memory_timer = eeprom[manual_memory_timer_e]; - #endif + manual_memory = eeprom[manual_memory_e]; + #ifdef USE_MANUAL_MEMORY_TIMER + manual_memory_timer = eeprom[manual_memory_timer_e]; + #endif + #ifdef USE_TINT_RAMPING + manual_memory_tint = eeprom[manual_memory_tint_e]; + #endif #endif #ifdef USE_TINT_RAMPING - tint = eeprom[tint_e]; + tint = eeprom[tint_e]; #endif #if defined(USE_PARTY_STROBE_MODE) || defined(USE_TACTICAL_STROBE_MODE) strobe_type = eeprom[strobe_type_e]; // TODO: move this to eeprom_wl? @@ -94,13 +97,16 @@ void save_config() { eeprom[ramp_discrete_steps_e] = ramp_stepss[1]; #endif #ifdef USE_MANUAL_MEMORY - eeprom[manual_memory_e] = manual_memory; - #ifdef USE_MANUAL_MEMORY_TIMER - eeprom[manual_memory_timer_e] = manual_memory_timer; - #endif + eeprom[manual_memory_e] = manual_memory; + #ifdef USE_MANUAL_MEMORY_TIMER + eeprom[manual_memory_timer_e] = manual_memory_timer; + #endif + #ifdef USE_TINT_RAMPING + eeprom[manual_memory_tint_e] = manual_memory_tint; + #endif #endif #ifdef USE_TINT_RAMPING - eeprom[tint_e] = tint; + eeprom[tint_e] = tint; #endif #if defined(USE_PARTY_STROBE_MODE) || defined(USE_TACTICAL_STROBE_MODE) eeprom[strobe_type_e] = strobe_type; // TODO: move this to eeprom_wl? diff --git a/spaghetti-monster/anduril/off-mode.c b/spaghetti-monster/anduril/off-mode.c index e37f08d..094cca8 100644 --- a/spaghetti-monster/anduril/off-mode.c +++ b/spaghetti-monster/anduril/off-mode.c @@ -133,8 +133,8 @@ uint8_t off_state(Event event, uint16_t arg) { && (off_time >= (manual_memory_timer * SLEEP_TICKS_PER_MINUTE)) #endif ) { - #if defined(USE_MANUAL_MEMORY_TIMER_FOR_TINT) && defined(USE_TINT_RAMPING) && defined(TINT_RAMP_TOGGLE_ONLY) - tint = 0; + #ifdef USE_TINT_RAMPING + tint = manual_memory_tint; #endif set_level(nearest_level(manual_memory)); } else diff --git a/spaghetti-monster/anduril/ramp-mode.c b/spaghetti-monster/anduril/ramp-mode.c index 9d6eba9..b0a86a0 100644 --- a/spaghetti-monster/anduril/ramp-mode.c +++ b/spaghetti-monster/anduril/ramp-mode.c @@ -393,6 +393,9 @@ uint8_t steady_state(Event event, uint16_t arg) { else if (event == EV_10clicks) { // turn on manual memory and save current brightness manual_memory = actual_level; + #ifdef USE_TINT_RAMPING + manual_memory_tint = tint; // remember tint too + #endif save_config(); blink_once(); return MISCHIEF_MANAGED; diff --git a/spaghetti-monster/anduril/tint-ramping.h b/spaghetti-monster/anduril/tint-ramping.h index bd86659..e482999 100644 --- a/spaghetti-monster/anduril/tint-ramping.h +++ b/spaghetti-monster/anduril/tint-ramping.h @@ -20,6 +20,10 @@ #ifndef TINT_RAMPING_H #define TINT_RAMPING_H +#ifdef USE_MANUAL_MEMORY +uint8_t manual_memory_tint; +#endif + // not actually a mode, more of a fallback under other modes uint8_t tint_ramping_state(Event event, uint16_t arg); -- cgit v1.2.3