mirror of
https://github.com/NawfalMotii79/PLFM_RADAR.git
synced 2026-06-09 06:57:15 +00:00
2c34323bcb
runRadarPulseSequence was redeclaring `int m, n, y` at function scope, which shadowed the file-scope `uint8_t m, n, y` globals at lines ~190-192 that getStatusString reports to the GUI as BeamPos|Azimuth|ChirpCount. The function's increments updated only the locals, then discarded them — so telemetry was permanently frozen at "BeamPos:1|Azimuth:1|ChirpCount:1" no matter how many beam positions or revolutions had elapsed. Fix: drop the three local declarations; the body already references m/n/y by name, so removing the locals lets the writes hit the globals. A comment documents the pitfall so the locals do not get re-added by a future cleanup. Numeric ranges are safe (m_max=32, n_max=31, y_max=50, all fit in uint8_t). Test: new standalone test_bug16_runradar_shadows_globals.c reproduces both the buggy (locals shadow globals) and fixed (globals advance) patterns and asserts the expected post-sweep values (g_n=16, g_m=1 wraps each iter, g_y=2 after one revolution). MCU regression: 76/76 (was 75).