The removal of unused USB commands that are still sent by the IDE
causes tinyusb boards to crash on connect currently. Flushing the
excess received bytes for unknown commands solves this issue.
This commit refactors the TinyUSB debug interface with the following changes:
- Handle disabled IRQs.
- Replace global variables with centralized state.
- Add timeout, and validation for more robust transfers (as much as possible
given the protocol limits).
- Remove obsolete/unsupported commands (attr read/write, script save etc..)
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>