hathach / tinyusb

An open source cross-platform USB stack for embedded system
https://www.tinyusb.org
MIT License
4.66k stars 996 forks source link

[FSDEV] Simplify toggle bit logic #2675

Closed Okarss closed 2 weeks ago

Okarss commented 2 weeks ago

Reduced the toggle bit logic to a single XOR. Improves performance, reduces size and simplifies source code. The original code is more than a decade old nonsense from ST, which is still present in their current code.

In addition made the delays in the initialization safer against the optimization.

HiFiPhile commented 2 weeks ago

Thanks, LGTM.