Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USB-USB: Hub and low speed device #658

Closed
tmk opened this issue Nov 5, 2020 · 1 comment
Closed

USB-USB: Hub and low speed device #658

tmk opened this issue Nov 5, 2020 · 1 comment

Comments

@tmk
Copy link
Owner

tmk commented Nov 5, 2020

When USB Hub is connected to the converter HUBPRE bit is set.
https://github.com/tmk/USB_Host_Shield_2.0/blob/master/usbhub.cpp#L187

The HUBPRE bit is not cleared even after the hub is removed. This prevents low speed device from working when plugging it into the converter directly without the hub. (It works after replug twice though.)

The bit should be reset in Release()? Not sure this is correct but this patch solves the problem anyway.

--- a/usbhub.cpp
+++ b/usbhub.cpp
@@ -217,7 +217,7 @@ uint8_t USBHub::Release() {
         pUsb->GetAddressPool().FreeAddress(bAddress);
 
         if(bAddress == 0x41)
-                pUsb->SetHubPreMask();
+                pUsb->ResetHubPreMask();
 
         bAddress = 0;
         bNbrPorts = 0;
tmk added a commit to tmk/USB_Host_Shield_2.0 that referenced this issue Nov 5, 2020
HUBPRE bits should be cleared after hub is removed.
tmk/tmk_keyboard#658
tmk added a commit to tmk/USB_Host_Shield_2.0 that referenced this issue Nov 5, 2020
HUBPRE bits should be cleared after hub is removed.
tmk/tmk_keyboard#658
@tmk
Copy link
Owner Author

tmk commented Nov 5, 2020

Fixed.

tmk/USB_Host_Shield_2.0@c28ad12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant