resend LED driver currents on currents change (do not wait for colors change) (#1932)

* test

* add missing
This commit is contained in:
openshwprojects
2026-01-07 15:43:11 +01:00
committed by GitHub
parent 972d68dcef
commit 4f4af7347c
7 changed files with 16 additions and 0 deletions

View File

@ -396,6 +396,15 @@ void LED_RunQuickColorLerp(int deltaMS) {
LED_I2CDriver_WriteRGBCW(led_rawLerpCurrent);
}
void LED_ResendCurrentColors() {
if (CFG_HasFlag(OBK_FLAG_LED_SMOOTH_TRANSITIONS)) {
LED_I2CDriver_WriteRGBCW(led_rawLerpCurrent);
}
else {
LED_I2CDriver_WriteRGBCW(finalColors);
}
}
int led_gamma_enable_channel_messages = 0;

View File

@ -306,6 +306,7 @@ OBK_Publish_Result LED_SendCurrentLightModeParam_TempOrColor();
void LED_ResetGlobalVariablesToDefaults();
extern float led_temperature_min;
extern float led_temperature_max;
void LED_ResendCurrentColors();
#endif
// cmd_test.c

View File

@ -76,6 +76,8 @@ commandResult_t BP1658CJ_Current(const void *context, const char *cmd, const cha
g_currentRGB = Tokenizer_GetArgInteger(0);
g_currentCW = Tokenizer_GetArgInteger(1);
LED_ResendCurrentColors();
return CMD_RES_OK;
}
// startDriver BP1658CJ

View File

@ -59,6 +59,7 @@ static void BP5758D_SetCurrent(byte curValRGB, byte curValCW) {
BP5758D_WriteCurrents();
Soft_I2C_Stop(&g_softI2C);
usleep(SM2135_DELAY);
LED_ResendCurrentColors();
}
static void BP5758D_PreInit() {
HAL_PIN_Setup_Output(g_softI2C.pin_clk);

View File

@ -89,6 +89,7 @@ commandResult_t KP18058_Current(const void *context, const char *cmd, const char
g_current_RGB = Tokenizer_GetArgIntegerRange(0, 0, 31);
g_current_CW = Tokenizer_GetArgIntegerRange(1, 0, 31);
LED_ResendCurrentColors();
return CMD_RES_OK;
}

View File

@ -143,6 +143,7 @@ commandResult_t CMD_LEDDriver_Map(const void *context, const char *cmd, const ch
static void SM2135_SetCurrent(int curValRGB, int curValCW) {
g_current_setting_rgb = curValRGB;
g_current_setting_cw = curValCW;
LED_ResendCurrentColors();
}
static commandResult_t SM2135_Current(const void *context, const char *cmd, const char *args, int flags){

View File

@ -70,6 +70,7 @@ void SM2235_Write(float *rgbcw) {
static void SM2235_SetCurrent(int curValRGB, int curValCW) {
g_cur_RGB = curValRGB;
g_cur_CW = curValCW;
LED_ResendCurrentColors();
}
static commandResult_t SM2235_Current(const void *context, const char *cmd, const char *args, int flags){