summaryrefslogtreecommitdiff
path: root/stmhal/usb.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-11-27 16:58:31 +0000
committerDamien George <damien.p.george@gmail.com>2014-11-27 16:58:31 +0000
commit5cbc9e0db0f01e1e643e8c091a536b54372df5bd (patch)
tree76d4375c28234440496278bdb937805f230715f0 /stmhal/usb.c
parent6f5eb84c1959b7929824a881a0438d0eee23d31a (diff)
stmhal: Reduce coupling between USB driver and readline.
This makes it easier to re-use readline.c and pyexec.c from stmhal in other ports.
Diffstat (limited to 'stmhal/usb.c')
-rw-r--r--stmhal/usb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/stmhal/usb.c b/stmhal/usb.c
index 2dc789894..0499aaa8d 100644
--- a/stmhal/usb.c
+++ b/stmhal/usb.c
@@ -54,7 +54,7 @@ STATIC mp_obj_t mp_const_vcp_interrupt = MP_OBJ_NULL;
void pyb_usb_init0(void) {
// create an exception object for interrupting by VCP
mp_const_vcp_interrupt = mp_obj_new_exception(&mp_type_KeyboardInterrupt);
- USBD_CDC_SetInterrupt(VCP_CHAR_NONE, mp_const_vcp_interrupt);
+ USBD_CDC_SetInterrupt(-1, mp_const_vcp_interrupt);
}
void pyb_usb_dev_init(usb_device_mode_t mode, usb_storage_medium_t medium) {
@@ -105,7 +105,7 @@ bool usb_vcp_is_connected(void) {
void usb_vcp_set_interrupt_char(int c) {
if (dev_is_enabled) {
- if (c != VCP_CHAR_NONE) {
+ if (c != -1) {
mp_obj_exception_clear_traceback(mp_const_vcp_interrupt);
}
USBD_CDC_SetInterrupt(c, mp_const_vcp_interrupt);