mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-10-11 22:39:50 +00:00
The two g_tx_completed spin loops in usb_write() had no timeout at all - if the host ever stopped pulling an IN packet while the device still read as enumerated, PM5 would spin forever with no recovery path. Add a spin-iteration bound (not tick-based: g_tx_completed is set from the USB core's own ISR, and the shared ticks timer is routinely stopped by LF/HF code at arbitrary points), matching the existing bounded-wait pattern used elsewhere in this codebase. Co-Authored-By: Claude Sonnet 5 <[email protected]>