Merge pull request #7227 from jepler/serial-break-is-interrupt
Allow serial "break" to trigger KeyboardInterrupt
This commit is contained in:
commit
0f6c708cb1
|
@ -341,7 +341,7 @@ bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_requ
|
|||
#endif // CIRCUITPY_USB_VENDOR
|
||||
|
||||
|
||||
#if MICROPY_KBD_EXCEPTION
|
||||
#if MICROPY_KBD_EXCEPTION && CIRCUITPY_USB_CDC
|
||||
|
||||
/**
|
||||
* Callback invoked when received an "wanted" char.
|
||||
|
@ -359,4 +359,10 @@ void tud_cdc_rx_wanted_cb(uint8_t itf, char wanted_char) {
|
|||
}
|
||||
}
|
||||
|
||||
void tud_cdc_send_break_cb(uint8_t itf, uint16_t duration_ms) {
|
||||
if (usb_cdc_console_enabled() && mp_interrupt_char != -1 && itf == 0 && duration_ms > 0) {
|
||||
mp_sched_keyboard_interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue