Along with the logic to handle multiple interfaces, commit
a26dc5116da806b5180958b0d5007d318c2a887b also introduced the following
bug:
When a keyboard or composite device with keyboard was replaced by a
mouse after enumeration, the stack would still poll the "keyboard",
which most likely resulted in the mouse data to be b drained and
discarded.
This patch clears the EP roles on disconnect.
---
softusb-input/main.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/softusb-input/main.c b/softusb-input/main.c
index 032517f..95176f4 100644
--- a/softusb-input/main.c
+++ b/softusb-input/main.c
@@ -441,6 +441,7 @@ static void check_discon(struct port_status *p, char name)
if(discon) {
print_string(disconnect); print_char(name); print_char('\n');
p->state = PORT_STATE_DISCONNECTED;
+ p->keyboard.ep = p->mouse.ep = 0;
}
}
--
1.7.1
_______________________________________________
http://lists.milkymist.org/listinfo.cgi/devel-milkymist.org
IRC: #milkymist@Freenode