diff --git a/src/micropython b/src/micropython index 6ee9ecd25..74f9806fe 160000 --- a/src/micropython +++ b/src/micropython @@ -1 +1 @@ -Subproject commit 6ee9ecd25f431e9a6906217602cf4322abe1b4a7 +Subproject commit 74f9806fe7c279cef9f2ad314439194fe0864111 diff --git a/src/omv/common/usbdbg.c b/src/omv/common/usbdbg.c index c541fb18b..681e2c078 100644 --- a/src/omv/common/usbdbg.c +++ b/src/omv/common/usbdbg.c @@ -41,6 +41,10 @@ static mp_obj_t mp_const_ide_interrupt = MP_OBJ_NULL; // These functions must be implemented in MicroPython CDC driver. extern uint32_t usb_cdc_buf_len(); extern uint32_t usb_cdc_get_buf(uint8_t *buf, uint32_t len); +void __attribute__((weak)) usb_cdc_reset_buffers() +{ + +} void usbdbg_init() { @@ -339,6 +343,9 @@ void usbdbg_control(void *buffer, uint8_t request, uint32_t length) // Disable IDE IRQ (re-enabled by pyexec or main). usbdbg_set_irq_enabled(false); + // Reset CDC buffers after disabling IRQs. + usb_cdc_reset_buffers(); + // interrupt running code by raising an exception mp_obj_exception_clear_traceback(mp_const_ide_interrupt);