mirror of
https://github.com/NawfalMotii79/PLFM_RADAR.git
synced 2026-06-09 06:57:15 +00:00
1317a91e01
The boot-time Idq calibration walks DAC_val from 126 down toward the 1.680 A target. Mid-walk readings sit well above the 2.5 A overcurrent threshold by design, and a channel that hits the safety_counter timeout (50 iters) can be left above the window. Without a gate, the next checkSystemHealth() pass would trip ERROR_RF_PA_OVERCURRENT and route straight into Emergency_Stop, killing the system mid-bringup. Added a `pa_calibration_in_progress` flag set TRUE around both DAC1 and DAC2 cal walks. checkSystemHealth's Idq window short-circuits while the flag is set; bias-fault and overcurrent thresholds remain fully active once the walk completes, so any genuinely stuck-high channel surfaces on the very next health pass and routes through the normal handler. Other health checks (lock, comm, temperature, watchdog) stay live during cal — no behavioural change to anything except the Idq window. Added test_mcu_a5_pa_cal_gate (7 cases): mid-walk masking, post-cal re-arming, stuck-high channel surfacing after gate clears, bias-fault gating, PowerAmplifier=false short-circuit, and a pre-fix regression case showing the buggy path would have tripped overcurrent mid-walk. MCU regression now 79/79.