shared/tinyusb: Use new persistent-tx-fifo configure interface.
The old configuration option has been removed from TinyUSB. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
parent
09fa90ed47
commit
b0ba151102
@ -40,6 +40,13 @@
|
|||||||
#include "device/dcd.h"
|
#include "device/dcd.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Initialise TinyUSB device.
|
||||||
|
static inline void mp_usbd_init_tud(void) {
|
||||||
|
tusb_init();
|
||||||
|
tud_cdc_configure_fifo_t cfg = { .rx_persistent = 0, .tx_persistent = 1 };
|
||||||
|
tud_cdc_configure_fifo(&cfg);
|
||||||
|
}
|
||||||
|
|
||||||
// Run the TinyUSB device task
|
// Run the TinyUSB device task
|
||||||
void mp_usbd_task(void);
|
void mp_usbd_task(void);
|
||||||
|
|
||||||
@ -125,7 +132,8 @@ inline static bool mp_usb_device_builtin_enabled(const mp_obj_usb_device_t *usbd
|
|||||||
|
|
||||||
static inline void mp_usbd_init(void) {
|
static inline void mp_usbd_init(void) {
|
||||||
// Without runtime USB support, this can be a thin wrapper wrapper around tusb_init()
|
// Without runtime USB support, this can be a thin wrapper wrapper around tusb_init()
|
||||||
tusb_init();
|
// which is called in the below helper function.
|
||||||
|
mp_usbd_init_tud();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -428,8 +428,10 @@ void mp_usbd_init(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (need_usb) {
|
if (need_usb) {
|
||||||
tusb_init(); // Safe to call redundantly
|
// The following will call tusb_init(), which is safe to call redundantly.
|
||||||
tud_connect(); // Reconnect if mp_usbd_deinit() has disconnected
|
mp_usbd_init_tud();
|
||||||
|
// Reconnect if mp_usbd_deinit() has disconnected.
|
||||||
|
tud_connect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -83,7 +83,6 @@
|
|||||||
#ifndef CFG_TUD_CDC_TX_BUFSIZE
|
#ifndef CFG_TUD_CDC_TX_BUFSIZE
|
||||||
#define CFG_TUD_CDC_TX_BUFSIZE ((CFG_TUD_MAX_SPEED == OPT_MODE_HIGH_SPEED) ? 512 : 256)
|
#define CFG_TUD_CDC_TX_BUFSIZE ((CFG_TUD_MAX_SPEED == OPT_MODE_HIGH_SPEED) ? 512 : 256)
|
||||||
#endif
|
#endif
|
||||||
#define CFG_TUD_CDC_PERSISTENT_TX_BUFF (1)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// MSC Configuration
|
// MSC Configuration
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user