diff options
| -rw-r--r-- | shared/tinyusb/mp_usbd.h | 1 | ||||
| -rw-r--r-- | shared/tinyusb/mp_usbd_cdc.c | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/shared/tinyusb/mp_usbd.h b/shared/tinyusb/mp_usbd.h index ef3234845..31234566b 100644 --- a/shared/tinyusb/mp_usbd.h +++ b/shared/tinyusb/mp_usbd.h @@ -125,7 +125,6 @@ inline static bool mp_usb_device_builtin_enabled(const mp_obj_usb_device_t *usbd static inline void mp_usbd_init(void) { // Without runtime USB support, this can be a thin wrapper wrapper around tusb_init() - extern bool tusb_init(void); tusb_init(); } diff --git a/shared/tinyusb/mp_usbd_cdc.c b/shared/tinyusb/mp_usbd_cdc.c index 63d015cb4..c6a88e467 100644 --- a/shared/tinyusb/mp_usbd_cdc.c +++ b/shared/tinyusb/mp_usbd_cdc.c @@ -95,6 +95,9 @@ void tud_cdc_rx_cb(uint8_t itf) { } mp_uint_t mp_usbd_cdc_tx_strn(const char *str, mp_uint_t len) { + if (!tusb_inited()) { + return 0; + } size_t i = 0; while (i < len) { uint32_t n = len - i; |
