|
|
@ -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) { //
|
|
|
|