fix: lufa handle disconnections gracefully
This commit is contained in:
committed by
Florian Didron
parent
54d6f5d4c5
commit
4a8aa15634
@@ -280,7 +280,11 @@ void webusb_send(uint8_t *data, uint8_t length) {
|
|||||||
|
|
||||||
Endpoint_SelectEndpoint(WEBUSB_IN_EPNUM);
|
Endpoint_SelectEndpoint(WEBUSB_IN_EPNUM);
|
||||||
|
|
||||||
Endpoint_Write_Stream_LE(data, length, NULL);
|
if(Endpoint_Write_Stream_LE(data, length, NULL)) {
|
||||||
|
// Stream failed to complete, resetting WEBUSB's state
|
||||||
|
webusb_state.paired = false;
|
||||||
|
webusb_state.pairing = false;
|
||||||
|
}
|
||||||
Endpoint_ClearIN();
|
Endpoint_ClearIN();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user