fixed usb serial not working after reconnect (#2196)

* fixed usb serial not working after reconnect

* added restart for sd over usb disconnect

* improved usb serial fix

* fixed formatting
This commit is contained in:
Bernd Herzog 2024-07-17 11:17:42 +02:00 committed by GitHub
parent 048359fb0e
commit 19eb6b44d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 25 additions and 5 deletions

View file

@ -42,6 +42,10 @@ CH_IRQ_HANDLER(USB0_IRQHandler) {
chSysUnlockFromIsr();
}
if (status & USB0_USBSTS_D_SLI) {
on_channel_closed();
}
CH_IRQ_EPILOGUE();
}
@ -131,11 +135,7 @@ usb_request_status_t usb_get_line_coding_request(usb_endpoint_t* const endpoint,
}
usb_request_status_t usb_set_control_line_state_request(usb_endpoint_t* const endpoint, const usb_transfer_stage_t stage) {
if (stage == USB_TRANSFER_STAGE_SETUP) {
// if (endpoint->setup.value == 3) {
on_channel_opened();
//} else {
// on_channel_closed();
//}
usb_transfer_schedule_ack(endpoint->in);
}