adafruit / Adafruit_TinyUSB_Arduino

Arduino library for TinyUSB
MIT License
450 stars 120 forks source link

Rework ESP32 configuration descriptor builder #372

Closed hathach closed 5 months ago

hathach commented 5 months ago

Previously configuration descriptor is built using esp32-hal-tinyusb.c since it is not possible to do so in application in early stage, since lots of callbacks is strong one in esp32 core. Apperantly, things got changes and it is possible now to override all those descriptor callback in arduino-esp32 core. esp32-hal-tinyusb.c build configuration during init() therefore not very dynamic which make it difficult to change descriptor in setup() while Video class has very sophisticaed descriptors hiearachy.

This PR make esp32 configuration descriptor is built/update just like other ports. There is quite a bit of changes but should not change the behavior since Serial still use ESP USBCDC implementation.

Also add new dwc2 driver for esp32 as well.