交错中性光低亮PDM脉冲

This commit is contained in:
2026-07-28 12:33:47 +08:00
parent 6b6a72d0ef
commit d80074def7
@@ -277,7 +277,16 @@ __RAM_CODE void Bridge_Deadtime_Expired(void)
(!frame_pdm_enabled ||
frame_pdm_threshold != pdm_threshold)) {
pdm_w_accumulator = pdm_threshold - w_step;
pdm_c_accumulator = pdm_threshold - c_step;
/*
* A 50:50 neutral target gives W and C identical PDM steps.
* Start C half a density cycle away from W so their optical
* pulses are spread across different frames instead of arriving
* as one bright pair followed by a long dark gap.
*/
if (pdm_threshold == BRIDGE_NEUTRAL_PDM_THRESHOLD)
pdm_c_accumulator = pdm_threshold / 2U;
else
pdm_c_accumulator = pdm_threshold - c_step;
}
frame_pdm_enabled = pdm_enabled;
frame_pdm_threshold = pdm_enabled ? pdm_threshold : 0U;