diff --git a/application/samples/wifi/ohos_connect/hilink_adapt/product/hilink_device.c b/application/samples/wifi/ohos_connect/hilink_adapt/product/hilink_device.c index 1c927d7..8441a01 100755 --- a/application/samples/wifi/ohos_connect/hilink_adapt/product/hilink_device.c +++ b/application/samples/wifi/ohos_connect/hilink_adapt/product/hilink_device.c @@ -459,9 +459,6 @@ int fast_report(const char* svc_id) // 云端模式:使用HILINK_ReportCharState err = HILINK_ReportCharState(svc_id, payload, len); HILINK_Printf("CLOUD report %s result is %d, payload:%s \r\n", svc_id, err, payload); - if (payload != NULL) { - free(payload); - } } if (payload) { diff --git a/application/ws63/user_main/spotlight/spotlight.h b/application/ws63/user_main/spotlight/spotlight.h index b2c63b0..897f36f 100755 --- a/application/ws63/user_main/spotlight/spotlight.h +++ b/application/ws63/user_main/spotlight/spotlight.h @@ -99,9 +99,9 @@ typedef struct __attribute__((packed, aligned(1))) { #define BRIGHTNESS_MIN 0 // 最小亮度 #define BRIGHTNESS_MAX 100 // 最大亮度 #define BRIGHTNESS_LOCAL_MIN 0 // 最小亮度 -#define BRIGHTNESS_LOCAL_MAX 1000 // 最大亮度 -#define BRIGHTNESS_REMOTE2LOCAL(x) (x * 10) //变化范围0 -1000 -#define BRIGHTNESS_LOCAL2REMOTE(x) (x / 10) +#define BRIGHTNESS_LOCAL_MAX 10000 // 最大亮度 +#define BRIGHTNESS_REMOTE2LOCAL(x) (x * 100) //变化范围0 -10000 +#define BRIGHTNESS_LOCAL2REMOTE(x) (x / 100) #define BRIGHTNESS_LITME_RANGE(x) do { \ if (x > BRIGHTNESS_LOCAL_MAX) x = BRIGHTNESS_LOCAL_MAX; \ @@ -131,7 +131,7 @@ typedef struct __attribute__((packed, aligned(1))) { #define FADE_INTERVAL_MIN (10*1000) //us #define NORMAL_FADE_TIME 3 //s -#define PWM_DUTY_RATIO_MAX 1000 +#define PWM_DUTY_RATIO_MAX 20000 //呼吸灯定义 #define BREARTH_PERIOD (3*1000*1000) //呼吸灯周期(Us) @@ -140,7 +140,7 @@ typedef struct __attribute__((packed, aligned(1))) { // PWM频率和周期定义 -#define PWM_FREQUENCY 3000 // PWM频率 2KHz +#define PWM_FREQUENCY 3000 // PWM频率 3KHz //渐变范围 #define SMOOTH_TIME_MAX 30 diff --git a/application/ws63/user_main/spotlight/spotlight_main.c b/application/ws63/user_main/spotlight/spotlight_main.c index 55ee6e1..cdb542e 100755 --- a/application/ws63/user_main/spotlight/spotlight_main.c +++ b/application/ws63/user_main/spotlight/spotlight_main.c @@ -462,11 +462,11 @@ void calculate_pwm_duty(device_control_t* pdevice_control) { // 如果开关关闭,则占空比为0 uint32_t total_brightness_pwm = pdevice_control->brightness_local; // 计算色温比例 (0-10000) - uint32_t cct_ratio = ((pdevice_control->cct_local - CCT_LOCAL_MIN) * 10000) / CCT_RANGE; + float cct_ratio = ((pdevice_control->cct_local - CCT_LOCAL_MIN) * 1.0) / CCT_RANGE; // 根据色温比例计算CW和WW的占空比 // 总亮度保持不变,只调整CW和WW的比例 - pdevice_control->duty_cw = (total_brightness_pwm * cct_ratio) / 10000; + pdevice_control->duty_cw = (total_brightness_pwm * cct_ratio); pdevice_control->duty_ww = total_brightness_pwm - pdevice_control->duty_cw; } @@ -515,8 +515,8 @@ void update_pwm_output(bool on_state, uint16_t duty_cw_val, uint16_t duty_ww_val uapi_pwm_start_group(CONFIG_PWM_GROUP_ID); if (should_print(&pwm_limiter)) { - e_printf("on:%d, cw:high:%u, low:%u, duty:%u/1000, ww:high:%u, low:%u, duty:%u/1000, offset_time:%u\r\n", - on_state, high_cnt_cw, low_cnt_cw, current_duty_cw, high_cnt_ww, low_cnt_ww, current_duty_ww, cfg_repeat.offset_time); + e_printf("on:%d, cw:high:%u, low:%u, duty:%u/%u, ww:high:%u, low:%u, duty:%u/%u, offset_time:%u\r\n", + on_state, high_cnt_cw, low_cnt_cw, current_duty_cw, PWM_DUTY_RATIO_MAX, high_cnt_ww, low_cnt_ww, current_duty_ww, PWM_DUTY_RATIO_MAX, cfg_repeat.offset_time); } } diff --git a/bootloader/flashboot_ws63/startup/main.c b/bootloader/flashboot_ws63/startup/main.c index fad6168..0f0d447 100755 --- a/bootloader/flashboot_ws63/startup/main.c +++ b/bootloader/flashboot_ws63/startup/main.c @@ -753,9 +753,9 @@ typedef struct __attribute__((packed, aligned(1))) { #define BRIGHTNESS_MIN 0 // 最小亮度 #define BRIGHTNESS_MAX 100 // 最大亮度 #define BRIGHTNESS_LOCAL_MIN 0 // 最小亮度 -#define BRIGHTNESS_LOCAL_MAX 1000 // 最大亮度 -#define BRIGHTNESS_REMOTE2LOCAL(x) (x * 10) //变化范围0 -1000 -#define BRIGHTNESS_LOCAL2REMOTE(x) (x / 10) +#define BRIGHTNESS_LOCAL_MAX 10000 // 最大亮度 +#define BRIGHTNESS_REMOTE2LOCAL(x) (x * 100) //变化范围0 -10000 +#define BRIGHTNESS_LOCAL2REMOTE(x) (x / 100) #define BRIGHTNESS_LITME_RANGE(x) do { \ if (x > BRIGHTNESS_LOCAL_MAX) x = BRIGHTNESS_LOCAL_MAX; \ @@ -785,7 +785,7 @@ typedef struct __attribute__((packed, aligned(1))) { #define FADE_INTERVAL_MIN (10*1000) //us #define NORMAL_FADE_TIME 3 //s -#define PWM_DUTY_RATIO_MAX 1000 +#define PWM_DUTY_RATIO_MAX 20000 //呼吸灯定义 #define BREARTH_PERIOD (3*1000*1000) //呼吸灯周期(Us) @@ -892,12 +892,12 @@ void calculate_pwm_duty(device_control_t* pdevice_control) pdevice_control->cct_local = SINGLE_COLOUR_CCT_LOCAL; } // 根据色温比例计算CW和WW的占空比 - // 计算色温比例 (0-10000) - uint16_t cct_ratio = ((pdevice_control->cct_local - CCT_LOCAL_MIN) * 10000) / CCT_RANGE; + // 计算色温比例 + float cct_ratio = ((pdevice_control->cct_local - CCT_LOCAL_MIN) * 1.0) / CCT_RANGE; // 根据色温比例计算CW和WW的占空比 // 总亮度保持不变,只调整CW和WW的比例 - pdevice_control->duty_cw = (total_brightness_pwm * cct_ratio) / 10000; + pdevice_control->duty_cw = total_brightness_pwm * cct_ratio; pdevice_control->duty_ww = total_brightness_pwm - pdevice_control->duty_cw; } diff --git a/output/SR_light-LPT262_hilink-20250804-1.0.7.fwpkg b/output/SR_light-LPT262_hilink-20250804-1.0.7.fwpkg new file mode 100644 index 0000000..9ac9456 Binary files /dev/null and b/output/SR_light-LPT262_hilink-20250804-1.0.7.fwpkg differ diff --git a/output/package(SR_light-LPT262_hilink-20250804-1.0.7).zip b/output/package(SR_light-LPT262_hilink-20250804-1.0.7).zip new file mode 100644 index 0000000..502c37c Binary files /dev/null and b/output/package(SR_light-LPT262_hilink-20250804-1.0.7).zip differ