diff options
Diffstat (limited to 'stmhal/usb.c')
-rw-r--r-- | stmhal/usb.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/stmhal/usb.c b/stmhal/usb.c index b0a66ef9b0..591cb321aa 100644 --- a/stmhal/usb.c +++ b/stmhal/usb.c @@ -96,9 +96,7 @@ const mp_obj_tuple_t pyb_usb_hid_keyboard_obj = { }; void pyb_usb_init0(void) { - // create an exception object for interrupting by VCP - MP_STATE_PORT(mp_const_vcp_interrupt) = mp_obj_new_exception(&mp_type_KeyboardInterrupt); - USBD_CDC_SetInterrupt(-1, MP_STATE_PORT(mp_const_vcp_interrupt)); + USBD_CDC_SetInterrupt(-1, MP_STATE_PORT(mp_kbd_exception)); MP_STATE_PORT(pyb_hid_report_desc) = MP_OBJ_NULL; } @@ -146,9 +144,9 @@ bool usb_vcp_is_enabled(void) { void usb_vcp_set_interrupt_char(int c) { if (pyb_usb_flags & PYB_USB_FLAG_DEV_ENABLED) { if (c != -1) { - mp_obj_exception_clear_traceback(MP_STATE_PORT(mp_const_vcp_interrupt)); + mp_obj_exception_clear_traceback(MP_STATE_PORT(mp_kbd_exception)); } - USBD_CDC_SetInterrupt(c, MP_STATE_PORT(mp_const_vcp_interrupt)); + USBD_CDC_SetInterrupt(c, MP_STATE_PORT(mp_kbd_exception)); } } |