diff options
| author | hathach <thach@tinyusb.org> | 2019-01-29 20:47:01 +0700 |
|---|---|---|
| committer | hathach <thach@tinyusb.org> | 2019-01-29 21:03:18 +0700 |
| commit | d1fb384a4a4cda91f293aac7ae49c570a97daa7c (patch) | |
| tree | be6eef3c101ac331b03f3bdafb73ccf40df89af7 /supervisor/shared | |
| parent | 765d877dfa829ef59cec0bb2980ecba3e3c3ae0f (diff) | |
update tinyusb, work better with sd
Diffstat (limited to 'supervisor/shared')
| -rw-r--r-- | supervisor/shared/usb/usb.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c index 5898323e8..b73c9f73f 100644 --- a/supervisor/shared/usb/usb.c +++ b/supervisor/shared/usb/usb.c @@ -54,10 +54,8 @@ void load_serial_number(void) { } } -bool _usb_enabled = false; - bool usb_enabled(void) { - return _usb_enabled; + return tusb_inited(); } void usb_init(void) { @@ -65,7 +63,6 @@ void usb_init(void) { load_serial_number(); tusb_init(); - _usb_enabled = true; #if MICROPY_KBD_EXCEPTION // Set Ctrl+C as wanted char, tud_cdc_rx_wanted_cb() callback will be invoked when Ctrl+C is received @@ -77,7 +74,7 @@ void usb_init(void) { } void usb_background(void) { - if (usb_enabled()) { + if (tusb_inited()) { tud_task(); tud_cdc_write_flush(); } |
