StartCountSspClk() declared its tmr_input_config_type on the stack
without initialising it and never set input_filter_value.
tmr_input_channel_init() copies that field into TMR2 CM1.C2DF, so the
digital input filter on the ssp_clk pin took whatever low nibble was
left on the stack, and could change from call to call depending on
the caller's stack contents.
TMR2 is clocked by that filtered input (C2DF2, external clock mode A),
so the filter decides which ssp_clk edges get counted. With fDTS at
288 MHz, filter values around 13 need ~556 ns of stable input against
a ~590 ns ssp_clk half period (fc/16 in 14a reader modes). Edges are
then dropped some of the time, and 14-15 drop every edge. In sniffer
mode (fc/8) values from about 10 already break. Lost ticks delay
frame timing derived from GetCountSspClk() (ReaderTransmit timing,
sync_time loops) by a varying amount. This shows up as random nonce
distance jitter and slow distance calibration in hf mf nested/autopwn
on PM5.
Zero-initialise the struct so the filter is off (C2DF = 0), matching
StartLoEdgeCapture() in the same file.
Reported by @adrian-stepien in #3709.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>