From 09fa90ed4718367eb9d7a2340d4f3e65da775e6b Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 24 Sep 2024 12:22:50 +1000 Subject: [PATCH 1/2] lib/tinyusb: Update to version 0.17.0. Includes support for RP2350, and improvements for ESP32. Signed-off-by: Damien George --- lib/tinyusb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tinyusb b/lib/tinyusb index d10b65ada4be7..5217cee5de4cd 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit d10b65ada4be7d5754b3128e80a9b4db72bdb23f +Subproject commit 5217cee5de4cd555018da90f9f1bcc87fb1c1d3a From b0ba151102a6c1b2e0e4c419c6482a64677c9b40 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 7 Aug 2024 14:20:35 +1000 Subject: [PATCH 2/2] shared/tinyusb: Use new persistent-tx-fifo configure interface. The old configuration option has been removed from TinyUSB. Signed-off-by: Damien George --- shared/tinyusb/mp_usbd.h | 10 +++++++++- shared/tinyusb/mp_usbd_runtime.c | 6 ++++-- shared/tinyusb/tusb_config.h | 1 - 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/shared/tinyusb/mp_usbd.h b/shared/tinyusb/mp_usbd.h index 31234566b6ca4..5c8f2a6095f30 100644 --- a/shared/tinyusb/mp_usbd.h +++ b/shared/tinyusb/mp_usbd.h @@ -40,6 +40,13 @@ #include "device/dcd.h" #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 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) { // 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 diff --git a/shared/tinyusb/mp_usbd_runtime.c b/shared/tinyusb/mp_usbd_runtime.c index 49553825776a7..a1eebeebd2fcd 100644 --- a/shared/tinyusb/mp_usbd_runtime.c +++ b/shared/tinyusb/mp_usbd_runtime.c @@ -428,8 +428,10 @@ void mp_usbd_init(void) { } if (need_usb) { - tusb_init(); // Safe to call redundantly - tud_connect(); // Reconnect if mp_usbd_deinit() has disconnected + // The following will call tusb_init(), which is safe to call redundantly. + mp_usbd_init_tud(); + // Reconnect if mp_usbd_deinit() has disconnected. + tud_connect(); } } diff --git a/shared/tinyusb/tusb_config.h b/shared/tinyusb/tusb_config.h index d0c9f89ec600c..0cc5ef03985ef 100644 --- a/shared/tinyusb/tusb_config.h +++ b/shared/tinyusb/tusb_config.h @@ -83,7 +83,6 @@ #ifndef CFG_TUD_CDC_TX_BUFSIZE #define CFG_TUD_CDC_TX_BUFSIZE ((CFG_TUD_MAX_SPEED == OPT_MODE_HIGH_SPEED) ? 512 : 256) #endif -#define CFG_TUD_CDC_PERSISTENT_TX_BUFF (1) #endif // MSC Configuration pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy