mirror of
https://github.com/gdsports/USBHost_t36
synced 2024-11-22 00:52:19 -05:00
Fix hub debounce timer port status requests
This commit is contained in:
parent
86c1bbe6ee
commit
920f71e768
4
hub.cpp
4
hub.cpp
@ -120,6 +120,7 @@ void USBHub::send_getstatus(uint32_t port)
|
|||||||
queue_Control_Transfer(device, &setup, &statusbits, this);
|
queue_Control_Transfer(device, &setup, &statusbits, this);
|
||||||
send_pending_getstatus &= ~(1 << port);
|
send_pending_getstatus &= ~(1 << port);
|
||||||
} else {
|
} else {
|
||||||
|
println("deferred getstatus, port = ", port);
|
||||||
send_pending_getstatus |= (1 << port);
|
send_pending_getstatus |= (1 << port);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -396,8 +397,9 @@ void USBHub::timer_event(USBDriverTimer *timer)
|
|||||||
println(", timer = ", (uint32_t)timer, HEX);
|
println(", timer = ", (uint32_t)timer, HEX);
|
||||||
if (timer == &debouncetimer) {
|
if (timer == &debouncetimer) {
|
||||||
uint32_t in_use = debounce_in_use;
|
uint32_t in_use = debounce_in_use;
|
||||||
|
println("ports in use bitmask = ", in_use, HEX);
|
||||||
if (in_use) {
|
if (in_use) {
|
||||||
for (uint32_t i=1; i < numports; i++) {
|
for (uint32_t i=1; i <= numports; i++) {
|
||||||
if (in_use & (1 << i)) send_getstatus(i);
|
if (in_use & (1 << i)) send_getstatus(i);
|
||||||
}
|
}
|
||||||
debouncetimer.start(20000);
|
debouncetimer.start(20000);
|
||||||
|
@ -27,7 +27,8 @@ USBHost myusb;
|
|||||||
USBHub hub1;
|
USBHub hub1;
|
||||||
USBHub hub2;
|
USBHub hub2;
|
||||||
USBHub hub3;
|
USBHub hub3;
|
||||||
KeyboardController keyboard;
|
KeyboardController keyboard1;
|
||||||
|
KeyboardController keyboard2;
|
||||||
MIDIDevice midi1;
|
MIDIDevice midi1;
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
|
Loading…
Reference in New Issue
Block a user