Every bidirectional EM4x50 command (rdbl, info, dump, lf search) failed
on a PM3 Easy with a 500 uH antenna, while `lf em 4x50 reader` worked.
A raw ADC capture of the exchange showed RM being sent into the tag data
right after the double listen window: find_em4x50_tag() consumes the
first window, the second one is then taken as the first, and
invalid_bit() cannot reject data because its single 3/4-bit sample of
the AC-coupled, saturating signal always sits between g_Low and g_High.
- detect the second listen window by the absence of a rising edge over
its 128-cycle low phase (Manchester data has one per bit)
- `lf em 4x50 config` (CMD_LF_EM4X50_CONFIG): threshold, pulse
tolerance, "0" bit gap start/end and RM delay, changeable at runtime
- defaults moved to the centres of the working ranges measured with the
new lf_em4x50_tune.lua sweep: tol 10 (5-15), gap end 38 (28-50),
rm 132 (104-164); the old gap end 32 was 4 cycles from failing
- rdbl/info retry the login + selective read for up to 1 s
- at debug level extended the whole exchange is captured into BigBuf,
fetch it with `data samples`
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>