From c2ac3319f2d3c6d79c40c1e4ba29e87dc83e9342 Mon Sep 17 00:00:00 2001 From: "ekko.bao" Date: Wed, 18 Jun 2025 07:55:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B8=90=E5=8F=98=E6=97=B6?= =?UTF-8?q?=E9=95=BF=E4=B8=BA0=E7=9A=84=E6=97=B6=E5=80=99=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E8=BF=9B=E8=A1=8C=E4=BF=9D=E5=AD=98=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E5=8D=87=E7=BA=A7=E5=90=8E=E7=81=AF=E6=89=93=E5=BC=80=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ohos_connect/hilink_adapt/product/device_profile.h | 2 +- application/ws63/user_main/spotlight/device_module.c | 1 - application/ws63/user_main/spotlight/spotlight_main.c | 7 +++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/application/samples/wifi/ohos_connect/hilink_adapt/product/device_profile.h b/application/samples/wifi/ohos_connect/hilink_adapt/product/device_profile.h index 905b6e5..4be48f6 100755 --- a/application/samples/wifi/ohos_connect/hilink_adapt/product/device_profile.h +++ b/application/samples/wifi/ohos_connect/hilink_adapt/product/device_profile.h @@ -30,7 +30,7 @@ extern "C" { #define DEVICE_HIVERSION "1.0.0" /* 设备固件版本号 */ -#define FIRMWARE_VER "1.0.0" +#define FIRMWARE_VER "1.0.1" /* 设备硬件版本号 */ #define HARDWARE_VER "1.0.0" /* 设备软件版本号 */ diff --git a/application/ws63/user_main/spotlight/device_module.c b/application/ws63/user_main/spotlight/device_module.c index 627e175..258e1fc 100644 --- a/application/ws63/user_main/spotlight/device_module.c +++ b/application/ws63/user_main/spotlight/device_module.c @@ -123,7 +123,6 @@ int myhandle_put_switch(const char* svc_id, const char* payload, unsigned int le } bool on = (item->valueint != 0); - g_device_control.on = on; ret = set_switch(on); cJSON_Delete(json); diff --git a/application/ws63/user_main/spotlight/spotlight_main.c b/application/ws63/user_main/spotlight/spotlight_main.c index 594d4a0..c34af37 100644 --- a/application/ws63/user_main/spotlight/spotlight_main.c +++ b/application/ws63/user_main/spotlight/spotlight_main.c @@ -506,10 +506,6 @@ void update_pwm_output(bool on_state, uint16_t duty_cw_val, uint16_t duty_ww_val uapi_pwm_open(channel_id_ww, &cfg_repeat); - // The line 'uint8_t channel_ids[2] = {channel_id_cw, channel_id_ww};' was present in the original code snippet from the checkpoint - // but seems unused before the uapi_pwm_start_group call. Retaining original behavior regarding this line. - // If it was indeed unused, it can be removed. For now, assuming it might have a purpose or was for debugging. - // uint8_t channel_ids[2] = {channel_id_cw, channel_id_ww}; // This line is commented out as it appears unused in the provided snippet. uapi_pwm_start_group(CONFIG_PWM_GROUP_ID); if (should_print(&pwm_limiter)) { @@ -897,6 +893,8 @@ int set_light(int32_t brightness_local, int32_t cct_local) return -111; // 异步上报 #endif } + g_device_control.cct_local = tmp_fade_ctx.target_cct; + g_device_control.brightness_local = tmp_fade_ctx.target_brightness; // no break; // 如果渐变时间是0则直接一步完成 default: //情景模式直接切换到对应的色温和亮度 set_switch(true); @@ -916,6 +914,7 @@ int set_switch(bool open) calculate_pwm_duty(); update_pwm_output(g_device_control.on, g_device_control.duty_cw, g_device_control.duty_ww); uapi_gpio_set_val(SWITCH_PIN, open ? OPEN_LIGHT : CLOSE_LIGHT); + req_save_device_data(); return 0; }