Closed xsrf closed 7 months ago
Actually USB Spec only require a SE0 for 2.5µs (TDDIS) to detect a disconnect and SystemInit()
followed by usb_setup()
already creates a ~200µs long SE0. However, I had problems with my USB hub disabling the port when my device switched from bootloader to keyboard and adding a delay in between fixed it 🤔 but now I'm not sure if the cause was something else.
@cnlohr Let me know if you think this delay() is actually misleading here and I'll remove it from the PR
The composite_hid descriptor didn't work properly on Windows (Keyboard worked, but Mouse didn't). With this change it works on Windows, Linux and MacOS.
Also added a delay between
SystemInit()
andusb_setup()
to ensure re-enumeration after bootloader or reset. This works because theD-
Pull-Up is disabled in that period. With a hardwired pullup one would needD-
to be pulled low actively to achieve the same.