From 20cec420ad5efe69e7331c07405fa8e8b2decee1 Mon Sep 17 00:00:00 2001 From: Andrei Gramakov Date: Thu, 16 Jul 2020 10:43:02 +0200 Subject: [PATCH 1/2] usb: configure_pins fix for tinyusb Closes https://github.com/espressif/esp-idf/issues/5588 --- components/tinyusb/port/esp32s2/src/tinyusb.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/components/tinyusb/port/esp32s2/src/tinyusb.c b/components/tinyusb/port/esp32s2/src/tinyusb.c index ca40bccdca..09fa53f68b 100644 --- a/components/tinyusb/port/esp32s2/src/tinyusb.c +++ b/components/tinyusb/port/esp32s2/src/tinyusb.c @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "tinyusb.h" -#include "hal/usb_hal.h" -#include "soc/usb_periph.h" -#include "soc/gpio_periph.h" -#include "hal/gpio_ll.h" -#include "esp_rom_gpio.h" -#include "driver/periph_ctrl.h" #include "driver/gpio.h" +#include "driver/periph_ctrl.h" +#include "esp_rom_gpio.h" +#include "hal/gpio_ll.h" +#include "hal/usb_hal.h" +#include "soc/gpio_periph.h" +#include "soc/usb_periph.h" +#include "tinyusb.h" static void configure_pins(usb_hal_context_t *usb) { @@ -34,7 +34,9 @@ static void configure_pins(usb_hal_context_t *usb) esp_rom_gpio_connect_out_signal(iopin->pin, iopin->func, false, false); } else { esp_rom_gpio_connect_in_signal(iopin->pin, iopin->func, false); - gpio_ll_input_enable(&GPIO, iopin->pin); + if ((iopin->pin != GPIO_MATRIX_CONST_ZERO_INPUT) && (iopin->pin != GPIO_MATRIX_CONST_ONE_INPUT)) { + gpio_ll_input_enable(&GPIO, iopin->pin); + } } esp_rom_gpio_pad_unhold(iopin->pin); } From a2b42b37f6ecc908263ccbafde8965bf49de6478 Mon Sep 17 00:00:00 2001 From: Andrei Gramakov Date: Fri, 24 Jul 2020 11:48:59 +0200 Subject: [PATCH 2/2] usb: removes non-integrated features --- components/tinyusb/Kconfig | 90 -------------------------------------- 1 file changed, 90 deletions(-) diff --git a/components/tinyusb/Kconfig b/components/tinyusb/Kconfig index 0223de32a4..e8184f3a35 100644 --- a/components/tinyusb/Kconfig +++ b/components/tinyusb/Kconfig @@ -9,75 +9,6 @@ menu "TinyUSB" help Adds support for TinyUSB - config USB_CDC_ENABLED - bool "Enable USB Serial (CDC) TinyUSB driver" - default n - depends on USB_ENABLED - help - Enable USB Serial (CDC) TinyUSB driver. - - config USB_CDC_RX_BUFSIZE - int "CDC FIFO size of RX" - default 64 - depends on USB_CDC_ENABLED - help - CDC FIFO size of RX - - config USB_CDC_TX_BUFSIZE - int "CDC FIFO size of TX" - default 64 - depends on USB_CDC_ENABLED - help - CDC FIFO size of TX - - config USB_MSC_ENABLED - bool "Enable Mass Storage (MSC) TinyUSB driver" - default n - depends on USB_ENABLED - help - Enable MSC TinyUSB driver. It is recomended to use Menuconfig-driven descriptor (.descriptor = NULL and - .string_descriptor = NULL in the tinyusb_config_t structure). - - config USB_MSC_BUFSIZE - int "MSC Buffer size of Device Mass storage" - default 512 - depends on USB_MSC_ENABLED - help - MSC Buffer size of Device Mass storage - - - config USB_HID_ENABLED - bool "Enable HID TinyUSB driver" - default n - depends on USB_ENABLED - help - Enable HID TinyUSB driver. It is recomended to use Menuconfig-driven descriptor (.descriptor = NULL and - .string_descriptor = NULL in the tinyusb_config_t structure). - - config USB_HID_BUFSIZE - int "HID buffer size Should be sufficient to hold ID (if any) + Data" - default 16 - depends on USB_HID_ENABLED - help - HID buffer size Should be sufficient to hold ID (if any) + Data - - - config USB_MIDI_ENABLED - bool "Enable MIDI TinyUSB driver" - default n - depends on USB_ENABLED - help - Enable MIDI TinyUSB driver. It is recomended to use Menuconfig-driven descriptor (.descriptor = NULL - and .string_descriptor = NULL in the tinyusb_config_t structure). - - config USB_CUSTOM_CLASS_ENABLED - bool "Enable a custom TinyUSB class" - default n - depends on USB_ENABLED - help - Enable a custom TinyUSB class. It is recomended to use Menuconfig-driven descriptor (.descriptor = NULL - and .string_descriptor = NULL in the tinyusb_config_t structure). - config USB_DEBUG bool "Debug mode" default n @@ -143,27 +74,6 @@ menu "TinyUSB" help Specify serial number of the USB device - config USB_DESC_CDC_STRING - string "CDC Device String" - default "Espressif CDC Device" - depends on USB_CDC_ENABLED - help - Specify name of the CDC device - - config USB_DESC_MSC_STRING - string "MSC Device String" - default "Espressif MSC Device" - depends on USB_MSC_ENABLED - help - Specify name of the MSC device - - config USB_DESC_HID_STRING - string "HID Device String" - default "Espressif HID Device" - depends on USB_HID_ENABLED - help - Specify name of the HID device - endmenu endmenu