fix(mcu): P-5 — align radar params with PR-F/PR-Q.1; document mode-01 production stance

main.cpp pre-PR-F constants caused two issues:
  - m_max = 32 disagreed with RP_CHIRPS_PER_FRAME = 48 (3 sub-frames * 16);
    getStatusString reported "32 chirps/position" to the GUI, false telemetry.
  - PRI MEDIUM = 161 us (PR-Q.1 stagger) was missing entirely; the MCU only
    knew SHORT=175 / LONG=167. T2 was also stuck at the pre-PR-E 0.5 us
    SHORT chirp width; PR-E switched to 1.0 us.

Fixes:
  - m_max 32 -> 48; T2 0.5 -> 1.0; new T_MEDIUM=5.0, PRI_MEDIUM=161.0 constants.
  - Big doc-comment above runRadarPulseSequence states the production stance:
    FPGA cold-resets to mode 2'b01 (auto-scan) so the MCU's chirp GPIO toggles
    are no-ops; pass-through mode 2'b00 needs a 3-PRI loop the MCU does not
    yet emit, so mode-00 is operationally unsupported until that's built.
  - Removed the redundant /* */ block-comment shadow of the same constants
    that had `T2` defined twice (typo for `PRI2`); pure dead-code cleanup.
  - test_bug16_runradar_shadows_globals.c m_max 32 -> 48 with refreshed
    arithmetic comment; binary still PASSes all 4 checks (g_m wraps to 1
    each iter regardless of m_max value).

No GPIO timing change (would need hardware verification). Audit P-5 closes
with the documented mode-01 stance; rebuilding the loop for mode-00 stays
on the backlog if/when pass-through becomes a deployment requirement.
This commit is contained in:
Jason
2026-05-02 16:40:32 +05:45
parent 8004c59674
commit b505266f33
2 changed files with 37 additions and 19 deletions
@@ -20,8 +20,9 @@
#include <stdio.h>
#include <stdint.h>
/* Match main.cpp lines 182-183, 190-193 */
static const int m_max = 32;
/* Mirror main.cpp m_max/n_max (P-5 update: m_max 32 -> 48 to match
* RP_CHIRPS_PER_FRAME = 48 = 3 sub-frames * 16 chirps from PR-F). */
static const int m_max = 48;
static const int n_max = 31;
static uint8_t g_m;
@@ -101,8 +102,8 @@ int main(void)
printf("PASS: g_n advanced to 16 after 15 beam positions\n");
}
/* m: each iter adds 3*(m_max/2)=48; reset to 1 when m>m_max=32.
* 1+48=49 -> reset to 1. So after every iter m=1. */
/* m: each iter adds 3*(m_max/2)=72; reset to 1 when m>m_max=48.
* 1+72=73 -> reset to 1. So after every iter m=1. */
if (g_m != 1) {
fprintf(stderr, "FAIL: g_m=%u (expected 1 after wrap)\n", g_m);
failures++;