diff --git a/src/drivers/nl_sm2135eh.c b/src/drivers/nl_sm2135eh.c index da0f95e..6730251 100644 --- a/src/drivers/nl_sm2135eh.c +++ b/src/drivers/nl_sm2135eh.c @@ -7,6 +7,7 @@ #define SM_ADDR_CURRENT 0xC0u #define SM_ADDR_WY 0xC5u #define SM_CHANNEL_WY 0x80u /* channel select bit 7: 0 = RGB, 1 = WY */ +#define SM_CHANNEL_STBY 0x20u /* standby bit 5: powers the outputs down */ extern void delay_us(unsigned int us); /* provided by libwlan.a */ @@ -76,7 +77,15 @@ void nl_sm2135eh_set(const uint8_t ch[NL_CH_COUNT]) s_have_last = true; if (!white) { - uint8_t d[6] = {SM_ADDR_CURRENT, s_current, 0x00, ch[NL_CH_B], ch[NL_CH_G], ch[NL_CH_R]}; + /* All channels dark: put the driver into standby instead of just writing zero duty. + Without bit 5 the chip stays active and leaks enough current to keep the lamp + faintly glowing - measured on a migrated GU10 RGB, 2026-09-13. The old QConnex + firmware had this logic but left it commented out (qcl_lamp.c), which is why the + behaviour was inherited. Lamps driven straight from PWM pins (G95, the CW variants) + are unaffected. Turning back on writes 0x00 or SM_CHANNEL_WY here and clears it. */ + bool dark = !ch[NL_CH_R] && !ch[NL_CH_G] && !ch[NL_CH_B]; + uint8_t chan = dark ? SM_CHANNEL_STBY : 0x00u; + uint8_t d[6] = {SM_ADDR_CURRENT, s_current, chan, ch[NL_CH_B], ch[NL_CH_G], ch[NL_CH_R]}; sm_send(d, 6); } else { uint8_t h[3] = {SM_ADDR_CURRENT, s_current, SM_CHANNEL_WY};