去除提前开机的亮灯的策略,确保开机渐变。

This commit is contained in:
2025-08-08 07:58:54 +08:00
parent 51c4af5a86
commit 3165aafe83
5 changed files with 12 additions and 17 deletions

View File

@@ -30,7 +30,7 @@ extern "C" {
#define DEVICE_HIVERSION "1.0.0" #define DEVICE_HIVERSION "1.0.0"
/* 设备固件版本号 */ /* 设备固件版本号 */
#define FIRMWARE_VER "1.0.9" #define FIRMWARE_VER "1.0.10"
/* 设备硬件版本号 */ /* 设备硬件版本号 */
#define HARDWARE_VER "1.0.0" #define HARDWARE_VER "1.0.0"
/* 设备软件版本号 */ /* 设备软件版本号 */

View File

@@ -380,8 +380,8 @@ static void init_fade_ctx(void)
// 设置默认更新间隔 // 设置默认更新间隔
fade_ctx.update_interval = FADE_INTERVAL_MIN; fade_ctx.update_interval = FADE_INTERVAL_MIN;
fade_ctx.current_brightness = g_device_control.brightness_local; // fade_ctx.current_brightness = g_device_control.brightness_local;
fade_ctx.current_cct = g_device_control.cct_local; // fade_ctx.current_cct = g_device_control.cct_local;
} }
// 初始化呼吸灯控制 // 初始化呼吸灯控制
@@ -735,8 +735,8 @@ void read_device_data(void)
data.control.read_done = false; data.control.read_done = false;
g_device_control = data.control; g_device_control = data.control;
// fastboot的时候就已经亮起来了所以当前测温直接变为目标值 // fastboot的时候就已经亮起来了所以当前测温直接变为目标值
fade_ctx.current_brightness = g_device_control.brightness_local; // fade_ctx.current_brightness = g_device_control.brightness_local;
fade_ctx.current_cct = g_device_control.cct_local; // fade_ctx.current_cct = g_device_control.cct_local;
lab_exit: lab_exit:
#endif #endif
g_device_control.read_done = true; g_device_control.read_done = true;
@@ -885,20 +885,15 @@ int set_light(light_ctrl_source_e source,
cancel_current_light_fade(); cancel_current_light_fade();
} }
// 如果打开灯,则需要手动将前置状态设置为关闭的样子,这样子后面计算渐变才能正常计算 // 如果打开灯,则需要手动将前置状态设置为关闭的样子,这样子后面计算渐变才能正常计算
if (APP_OPEN_LIGHT == source) { if (APP_OPEN_LIGHT == source || DEV_POWER_ON == source) {
g_device_control.on = true; g_device_control.on = true;
// fade_ctx.current_brightness = 0; // fade_ctx.current_brightness = 0;
brightness_local_target = g_device_control.brightness_local; brightness_local_target = g_device_control.brightness_local;
if (g_device_control.colourMode == COLOUR_MODE_DUAL) { // 色温不进行变化,只改变亮度
fade_ctx.current_cct = g_device_control.cct_local; fade_ctx.current_cct = g_device_control.cct_local;
cct_local_target = g_device_control.cct_local; cct_local_target = g_device_control.cct_local;
} else {
fade_ctx.current_cct = SINGLE_COLOUR_CCT_LOCAL; if (g_device_control.colourMode != COLOUR_MODE_DUAL) {
cct_local_target = SINGLE_COLOUR_CCT_LOCAL;
}
}
else if (DEV_POWER_ON == source) {
if (g_device_control.colourMode == COLOUR_MODE_SINGLE) {
fade_ctx.current_cct = SINGLE_COLOUR_CCT_LOCAL; fade_ctx.current_cct = SINGLE_COLOUR_CCT_LOCAL;
cct_local_target = SINGLE_COLOUR_CCT_LOCAL; cct_local_target = SINGLE_COLOUR_CCT_LOCAL;
} }

View File

@@ -649,7 +649,7 @@ static void dump_io_level(void)
} }
#define FASTBOOT_PWM 1 //CONFIG_PWM_USING_V151 #define FASTBOOT_PWM 0 //CONFIG_PWM_USING_V151
#if FASTBOOT_PWM #if FASTBOOT_PWM

Binary file not shown.