diff --git a/README.md b/README.md index 200d587..eafefc6 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,4 @@ V4: 2.配置 地址,数值 地址,数值 - - ``` \ No newline at end of file diff --git a/src/camera_light_src_timing_controller/clst_controler.cpp b/src/camera_light_src_timing_controller/clst_controler.cpp index 1689890..b1f05c4 100644 --- a/src/camera_light_src_timing_controller/clst_controler.cpp +++ b/src/camera_light_src_timing_controller/clst_controler.cpp @@ -536,7 +536,18 @@ zaf_error_code_t CLSTControler::LightSrcX_setLightIntensityDuty(int32_t index, f uint32_t freqcnt = 0; DO_CMD(reg_read(kreg_light_ctrol_module1_light_driver_freq_cnt + (index - 1) * 32, freqcnt)); + if (duty >= 99) { + duty = 99; + } + uint32_t cnt = freqcnt * (duty / 100.0); + if (duty < 1) { + cnt = 1; + } + if (cnt >= freqcnt) { + cnt = freqcnt - 1; + } + return reg_write(kreg_light_ctrol_module1_light_intensity_cnt + (index - 1) * 32, cnt); } zaf_error_code_t CLSTControler::LightSrcX_setLightDriverFreq(int32_t index, float freq) { //