diff --git a/fsm/chan-rgbaux.h b/fsm/chan-rgbaux.h index bfb0f559..ef6ee375 100644 --- a/fsm/chan-rgbaux.h +++ b/fsm/chan-rgbaux.h @@ -46,6 +46,7 @@ .set_level = set_level_auxgrn, \ .gradual_tick = gradual_tick_null \ AUX_RGB_HAS_ARGS \ + AUX_RGB_USES_AUX \ }, \ { \ .set_level = set_level_auxcyn, \ diff --git a/fsm/ramping.c b/fsm/ramping.c index df2ccc01..53c93081 100644 --- a/fsm/ramping.c +++ b/fsm/ramping.c @@ -40,16 +40,20 @@ inline void set_level_aux_leds(uint8_t level) { // TODO: maybe move this stuff into FSM #include "anduril/aux-leds.h" // for rgb_led_voltage_readout() inline void set_level_aux_rgb_leds(uint8_t level) { - if ((! go_to_standby) +// if ((! go_to_standby) + if ( #ifdef USE_CHANNEL_USES_AUX - && (!channel_uses_aux(channel_mode)) +// && (!channel_uses_aux(channel_mode)) + (!channel_uses_aux(channel_mode)) + #else + (! go_to_standby) #endif ){ if (level > 0) { rgb_led_voltage_readout(level > USE_AUX_RGB_LEDS_WHILE_ON); - } else { - rgb_led_set(0); - } + }// 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 @@ -136,6 +140,14 @@ void set_level(uint8_t level) { #endif #ifdef USE_AUX_RGB_LEDS_WHILE_ON + #ifdef USE_CHANNEL_USES_AUX + if (!channel_uses_aux(channel_mode)) { + set_level_aux_rgb_leds(level); + } + #else + set_level_aux_rgb_leds(level); + #endif + set_level_aux_rgb_leds(level); #endif @@ -148,6 +160,11 @@ void set_level(uint8_t level) { if (0 == level) { set_level_zero(); + #ifdef USE_CHANNEL_USES_AUX + if (channel_uses_aux(channel_mode)){ + rgb_led_set(0); + } + #endif } else { // call the relevant hardware-specific set_level_*() SetLevelFuncPtr set_level_func = channels[channel_mode].set_level;