mirror of
https://github.com/micropython/micropython.git
synced 2026-01-07 12:40:15 +01:00
shared/tinyusb: Fix build errors with CDC support disabled.
This commit makes possible building MicroPython with USB CDC support disabled. The original code does support such a configuration but missed a few spots where build errors would arise. These changes fix the remaining issues, fixing also warnings caused by the changes needed to make the build succeed. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit is contained in:
committed by
Damien George
parent
c7c0ad222e
commit
5f3e6b5b53
@@ -38,13 +38,16 @@
|
||||
#ifndef NO_QSTR
|
||||
#include "tusb.h"
|
||||
#include "device/dcd.h"
|
||||
#include "class/cdc/cdc_device.h"
|
||||
#endif
|
||||
|
||||
// Initialise TinyUSB device.
|
||||
static inline void mp_usbd_init_tud(void) {
|
||||
tusb_init();
|
||||
#if MICROPY_HW_USB_CDC
|
||||
tud_cdc_configure_fifo_t cfg = { .rx_persistent = 0, .tx_persistent = 1 };
|
||||
tud_cdc_configure_fifo(&cfg);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Run the TinyUSB device task
|
||||
|
||||
Reference in New Issue
Block a user