diff options
| author | Selene ToyKeeper | 2025-08-31 16:58:17 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2025-08-31 16:58:17 -0600 |
| commit | 7a8d5f4c69fdfbd1d4b329427bb8ed75da12a1a6 (patch) | |
| tree | 3fa02a56818346f5bab8da9474d14e2122774a57 /fsm/ramping.c | |
| parent | renamed wurkkos-ts25-boost to wurkkos-ts26 (diff) | |
| parent | ChangeLog for new minor release (diff) | |
| download | anduril-7a8d5f4c69fdfbd1d4b329427bb8ed75da12a1a6.tar.gz anduril-7a8d5f4c69fdfbd1d4b329427bb8ed75da12a1a6.tar.bz2 anduril-7a8d5f4c69fdfbd1d4b329427bb8ed75da12a1a6.zip | |
Merge branch 'trunk' into wurkkos-ts25-boost
just getting the latest upstream changes
* trunk:
ChangeLog for new minor release
spacing, misc cleanup, made anchors work, fixed bad link
there's another inherited setting now
added more info about manual memory remembering channel mode
space
added info about simple vs advanced UI, and attiny85 battcheck resolution
reworded a bit for consistency with the rest of the manual
made new settings apply to all button LEDs on lights bigger than 8K ROM
Manual: Add how to check which UI the user is in
Manual: Document extra digit for battery check
Manual: Add default for post-off voltage display
Manual: Add channel mode to manual memory
Manual: Update options inherited by Simple UI
Add a feature to make RGB voltage configurable
Improve manual - add links for navigability, and an FAQ
Document aux LED settings in Tactical Mode
Diffstat (limited to 'fsm/ramping.c')
| -rw-r--r-- | fsm/ramping.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/fsm/ramping.c b/fsm/ramping.c index 743e619..f8ca4ec 100644 --- a/fsm/ramping.c +++ b/fsm/ramping.c @@ -8,14 +8,20 @@ #ifdef HAS_AUX_LEDS inline void set_level_aux_leds(uint8_t level) { + #ifdef USE_AUX_THRESHOLD_CONFIG + #define AUX_BRIGHTNESS ((level > cfg.button_led_low_ramp_level) \ + << (level > cfg.button_led_high_ramp_level)) + #else + #define AUX_BRIGHTNESS ((level > 0) + (level > DEFAULT_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 - indicator_led((level > 0) + (level > DEFAULT_LEVEL)); + indicator_led(AUX_BRIGHTNESS); #endif #ifdef USE_BUTTON_LED - button_led_set((level > 0) + (level > DEFAULT_LEVEL)); + button_led_set(AUX_BRIGHTNESS); #endif } #else // turn off front-facing aux LEDs while main LEDs are on @@ -27,12 +33,15 @@ inline void set_level_aux_leds(uint8_t level) { #ifdef USE_AUX_RGB_LEDS rgb_led_set(0); #ifdef USE_BUTTON_LED - button_led_set((level > 0) + (level > DEFAULT_LEVEL)); + button_led_set(AUX_BRIGHTNESS); #endif #endif } #endif #endif + #ifdef AUX_BRIGHTNESS + #undef AUX_BRIGHTNESS + #endif } #endif // ifdef HAS_AUX_LEDS @@ -41,15 +50,28 @@ inline void set_level_aux_leds(uint8_t level) { #include "anduril/aux-leds.h" // for rgb_led_voltage_readout() inline void set_level_aux_rgb_leds(uint8_t level) { if (! go_to_standby) { + #ifdef USE_AUX_THRESHOLD_CONFIG + if (level > cfg.button_led_low_ramp_level) { + rgb_led_voltage_readout(level > cfg.button_led_high_ramp_level); + } + #else if (level > 0) { rgb_led_voltage_readout(level > USE_AUX_RGB_LEDS_WHILE_ON); - } else { + } + #endif + else { rgb_led_set(0); } // some drivers can be wired with RGB or single color to button // ... so support both even though only one is connected #ifdef USE_BUTTON_LED + #ifdef USE_AUX_THRESHOLD_CONFIG + button_led_set( + (level > cfg.button_led_low_ramp_level) + << (level > cfg.button_led_high_ramp_level)); + #else button_led_set((level > 0) + (level > DEFAULT_LEVEL)); + #endif #endif } } |
