diff --git a/project/example/ble/ble_peripheral/app/src/bridge_pwm.c b/project/example/ble/ble_peripheral/app/src/bridge_pwm.c index cd0cf73..51b6e96 100644 --- a/project/example/ble/ble_peripheral/app/src/bridge_pwm.c +++ b/project/example/ble/ble_peripheral/app/src/bridge_pwm.c @@ -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;