summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2021-04-19 13:01:50 +0700
committerGitHub <[email protected]>2021-04-19 13:01:50 +0700
commit01801c881b464927e4c7e4f67fe0b9cd41bf0e5f (patch)
treedb6a276757962e08eba290abe7113d6616d47ca6 /src
parentf2874f2431daa0966984310a10d17ae8693944d2 (diff)
parent803b755554a69221f6d05a4b245f24045dfcd644 (diff)
Merge pull request #783 from alisitsyn/esp-based_on_334e95f
WIP: Add new Espressif target esp32s3 for tinyUSB
Diffstat (limited to 'src')
-rw-r--r--src/osal/osal_freertos.h4
-rw-r--r--src/portable/espressif/esp32sx/dcd_esp32sx.c (renamed from src/portable/espressif/esp32s2/dcd_esp32s2.c)7
-rw-r--r--src/tusb_option.h1
3 files changed, 7 insertions, 5 deletions
diff --git a/src/osal/osal_freertos.h b/src/osal/osal_freertos.h
index 004bd1b6b..66070c273 100644
--- a/src/osal/osal_freertos.h
+++ b/src/osal/osal_freertos.h
@@ -67,7 +67,7 @@ static inline bool osal_semaphore_post(osal_semaphore_t sem_hdl, bool in_isr)
BaseType_t xHigherPriorityTaskWoken;
BaseType_t res = xSemaphoreGiveFromISR(sem_hdl, &xHigherPriorityTaskWoken);
-#if CFG_TUSB_MCU == OPT_MCU_ESP32S2
+#if CFG_TUSB_MCU == OPT_MCU_ESP32S2 || CFG_TUSB_MCU == OPT_MCU_ESP32S3
if ( xHigherPriorityTaskWoken ) portYIELD_FROM_ISR();
#else
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
@@ -150,7 +150,7 @@ static inline bool osal_queue_send(osal_queue_t qhdl, void const * data, bool in
BaseType_t xHigherPriorityTaskWoken;
BaseType_t res = xQueueSendToBackFromISR(qhdl, data, &xHigherPriorityTaskWoken);
-#if CFG_TUSB_MCU == OPT_MCU_ESP32S2
+#if CFG_TUSB_MCU == OPT_MCU_ESP32S2 || CFG_TUSB_MCU == OPT_MCU_ESP32S3
if ( xHigherPriorityTaskWoken ) portYIELD_FROM_ISR();
#else
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
diff --git a/src/portable/espressif/esp32s2/dcd_esp32s2.c b/src/portable/espressif/esp32sx/dcd_esp32sx.c
index edbc872fe..74842a291 100644
--- a/src/portable/espressif/esp32s2/dcd_esp32s2.c
+++ b/src/portable/espressif/esp32sx/dcd_esp32sx.c
@@ -29,14 +29,14 @@
#include "tusb_option.h"
#include "common/tusb_fifo.h"
-#if CFG_TUSB_MCU == OPT_MCU_ESP32S2 && TUSB_OPT_DEVICE_ENABLED
+#if (((CFG_TUSB_MCU == OPT_MCU_ESP32S2) || (CFG_TUSB_MCU == OPT_MCU_ESP32S3)) && TUSB_OPT_DEVICE_ENABLED)
// Espressif
#include "driver/periph_ctrl.h"
#include "freertos/xtensa_api.h"
#include "esp_intr_alloc.h"
#include "esp_log.h"
-#include "esp32s2/rom/gpio.h"
+#include "driver/gpio.h"
#include "soc/dport_reg.h"
#include "soc/gpio_sig_map.h"
#include "soc/usb_periph.h"
@@ -254,6 +254,7 @@ bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const *desc_edpt)
uint8_t const epnum = tu_edpt_number(desc_edpt->bEndpointAddress);
uint8_t const dir = tu_edpt_dir(desc_edpt->bEndpointAddress);
+ TU_ASSERT(desc_edpt->wMaxPacketSize.size <= 64);
TU_ASSERT(epnum < EP_MAX);
xfer_ctl_t *xfer = XFER_CTL_BASE(epnum, dir);
@@ -863,5 +864,5 @@ void dcd_int_disable (uint8_t rhport)
esp_intr_free(usb_ih);
}
-#endif // OPT_MCU_ESP32S2
+#endif // #if OPT_MCU_ESP32S2 || OPT_MCU_ESP32S3
diff --git a/src/tusb_option.h b/src/tusb_option.h
index 7585a9ff6..9fcc6c565 100644
--- a/src/tusb_option.h
+++ b/src/tusb_option.h
@@ -94,6 +94,7 @@
// Espressif
#define OPT_MCU_ESP32S2 900 ///< Espressif ESP32-S2
+#define OPT_MCU_ESP32S3 901 ///< Espressif ESP32-S3
// Dialog
#define OPT_MCU_DA1469X 1000 ///< Dialog Semiconductor DA1469x