reworked usb serial communication (#1766)

This commit is contained in:
Bernd Herzog 2024-01-13 18:05:29 +01:00 committed by GitHub
parent 58307aee9c
commit 7a4c3184a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 188 additions and 53 deletions

View file

@ -31,11 +31,16 @@ static Thread* thread_usb_event = NULL;
CH_IRQ_HANDLER(USB0_IRQHandler) {
CH_IRQ_PROLOGUE();
const uint32_t status = USB0_USBSTS_D & USB0_USBINTR_D;
usb0_isr();
chSysLockFromIsr();
chEvtSignalI(thread_usb_event, EVT_MASK_USB);
chSysUnlockFromIsr();
if (status & USB0_USBSTS_D_UI) {
chSysLockFromIsr();
chEvtSignalI(thread_usb_event, EVT_MASK_USB);
chSysUnlockFromIsr();
}
CH_IRQ_EPILOGUE();
}