summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2022-02-18 16:22:50 +0700
committerGitHub <[email protected]>2022-02-18 16:22:50 +0700
commit4612332af75e7e807b766b73e092d0d87a075392 (patch)
tree3f28f8f08334490e1c2e683dd4103bcfb0fe39f8
parent553767cc8a1948dda53ca1b3cc8d9e2bd21ca3e7 (diff)
parent52645fcc1b6f00d4bf6b211a5425addf7d3a1e8c (diff)
Merge pull request #1331 from hathach/fix-esp-build
fix build with latest esp idf
-rw-r--r--examples/device/cdc_msc_freertos/src/CMakeLists.txt4
-rw-r--r--examples/device/hid_composite_freertos/src/CMakeLists.txt4
-rw-r--r--hw/bsp/esp32s2/boards/esp32s2.c2
-rw-r--r--hw/bsp/esp32s2/family.mk1
-rw-r--r--hw/bsp/esp32s3/boards/esp32s3.c2
-rw-r--r--src/osal/osal_freertos.h4
-rw-r--r--src/osal/osal_rtx4.h2
7 files changed, 15 insertions, 4 deletions
diff --git a/examples/device/cdc_msc_freertos/src/CMakeLists.txt b/examples/device/cdc_msc_freertos/src/CMakeLists.txt
index 93ae0686a..9216e2b49 100644
--- a/examples/device/cdc_msc_freertos/src/CMakeLists.txt
+++ b/examples/device/cdc_msc_freertos/src/CMakeLists.txt
@@ -13,6 +13,10 @@ target_include_directories(${COMPONENT_TARGET} PUBLIC
"${TOP}/src"
)
+target_compile_definitions(${COMPONENT_TARGET} PUBLIC
+ ESP_PLATFORM
+)
+
target_sources(${COMPONENT_TARGET} PUBLIC
"${TOP}/src/tusb.c"
"${TOP}/src/common/tusb_fifo.c"
diff --git a/examples/device/hid_composite_freertos/src/CMakeLists.txt b/examples/device/hid_composite_freertos/src/CMakeLists.txt
index 6f156379f..5d9fc74d3 100644
--- a/examples/device/hid_composite_freertos/src/CMakeLists.txt
+++ b/examples/device/hid_composite_freertos/src/CMakeLists.txt
@@ -13,6 +13,10 @@ target_include_directories(${COMPONENT_TARGET} PUBLIC
"${TOP}/src"
)
+target_compile_definitions(${COMPONENT_TARGET} PUBLIC
+ ESP_PLATFORM
+)
+
target_sources(${COMPONENT_TARGET} PUBLIC
"${TOP}/src/tusb.c"
"${TOP}/src/common/tusb_fifo.c"
diff --git a/hw/bsp/esp32s2/boards/esp32s2.c b/hw/bsp/esp32s2/boards/esp32s2.c
index a81181672..03ae9e366 100644
--- a/hw/bsp/esp32s2/boards/esp32s2.c
+++ b/hw/bsp/esp32s2/boards/esp32s2.c
@@ -32,8 +32,8 @@
#include "hal/usb_hal.h"
#include "soc/usb_periph.h"
-#include "driver/periph_ctrl.h"
#include "driver/rmt.h"
+#include "esp_private/periph_ctrl.h"
#ifdef NEOPIXEL_PIN
#include "led_strip.h"
diff --git a/hw/bsp/esp32s2/family.mk b/hw/bsp/esp32s2/family.mk
index 4b9000a6a..b95098e15 100644
--- a/hw/bsp/esp32s2/family.mk
+++ b/hw/bsp/esp32s2/family.mk
@@ -10,6 +10,7 @@ build: all
fullclean:
if test -f sdkconfig; then $(RM) -f sdkconfig ; fi
if test -d $(BUILD); then $(RM) -rf $(BUILD) ; fi
+ idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) $@
clean flash bootloader-flash app-flash erase monitor dfu-flash dfu size size-components size-files:
idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) $@
diff --git a/hw/bsp/esp32s3/boards/esp32s3.c b/hw/bsp/esp32s3/boards/esp32s3.c
index a81181672..03ae9e366 100644
--- a/hw/bsp/esp32s3/boards/esp32s3.c
+++ b/hw/bsp/esp32s3/boards/esp32s3.c
@@ -32,8 +32,8 @@
#include "hal/usb_hal.h"
#include "soc/usb_periph.h"
-#include "driver/periph_ctrl.h"
#include "driver/rmt.h"
+#include "esp_private/periph_ctrl.h"
#ifdef NEOPIXEL_PIN
#include "led_strip.h"
diff --git a/src/osal/osal_freertos.h b/src/osal/osal_freertos.h
index 4573e01f5..aa102b15c 100644
--- a/src/osal/osal_freertos.h
+++ b/src/osal/osal_freertos.h
@@ -68,6 +68,7 @@ static inline bool osal_semaphore_post(osal_semaphore_t sem_hdl, bool in_isr)
BaseType_t res = xSemaphoreGiveFromISR(sem_hdl, &xHigherPriorityTaskWoken);
#if CFG_TUSB_MCU == OPT_MCU_ESP32S2 || CFG_TUSB_MCU == OPT_MCU_ESP32S3
+ // not needed after https://github.com/espressif/esp-idf/commit/c5fd79547ac9b7bae06fa660e9f814d18d3390b7
if ( xHigherPriorityTaskWoken ) portYIELD_FROM_ISR();
#else
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
@@ -151,6 +152,7 @@ static inline bool osal_queue_send(osal_queue_t qhdl, void const * data, bool in
BaseType_t res = xQueueSendToBackFromISR(qhdl, data, &xHigherPriorityTaskWoken);
#if CFG_TUSB_MCU == OPT_MCU_ESP32S2 || CFG_TUSB_MCU == OPT_MCU_ESP32S3
+ // not needed after https://github.com/espressif/esp-idf/commit/c5fd79547ac9b7bae06fa660e9f814d18d3390b7
if ( xHigherPriorityTaskWoken ) portYIELD_FROM_ISR();
#else
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
@@ -169,4 +171,4 @@ static inline bool osal_queue_empty(osal_queue_t qhdl)
}
#endif
-#endif /* _TUSB_OSAL_FREERTOS_H_ */
+#endif
diff --git a/src/osal/osal_rtx4.h b/src/osal/osal_rtx4.h
index 32d7782d9..f7e88e322 100644
--- a/src/osal/osal_rtx4.h
+++ b/src/osal/osal_rtx4.h
@@ -167,4 +167,4 @@ static inline bool osal_queue_empty(osal_queue_t qhdl)
}
#endif
-#endif /* _TUSB_OSAL_FREERTOS_H_ */
+#endif