mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-04 22:55:25 +00:00
resend LED driver currents on currents change (do not wait for colors change) (#1932)
* test * add missing
This commit is contained in:
@ -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;
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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){
|
||||
|
||||
@ -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){
|
||||
|
||||
Reference in New Issue
Block a user