summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2025-07-02 18:15:37 +0700
committerGitHub <[email protected]>2025-07-02 18:15:37 +0700
commit963971c6aa14411f0cc6f0c4f727d199c738e2a5 (patch)
tree45124e4246dd415bcab22119fa6b21f9ff363be3 /examples
parent0d6cb38163692fa8795d75b8eda9454c579bea4a (diff)
parenta52e5ce99aa4fba305e5b8639360d5b3990d7475 (diff)
Merge pull request #3157 from hathach/update-buildsystem
Update buildsystem
Diffstat (limited to 'examples')
-rw-r--r--examples/build_system/make/make.mk19
-rw-r--r--examples/device/audio_4_channel_mic_freertos/src/main.c11
-rw-r--r--examples/device/audio_4_channel_mic_freertos/src/tusb_config.h2
-rw-r--r--examples/device/audio_test_freertos/src/main.c8
-rw-r--r--examples/device/audio_test_freertos/src/tusb_config.h2
-rw-r--r--examples/device/board_test/src/main.c27
-rw-r--r--examples/device/board_test/src/tusb_config.h2
-rw-r--r--examples/device/cdc_msc_freertos/src/main.c8
-rw-r--r--examples/device/cdc_msc_freertos/src/tusb_config.h2
-rw-r--r--examples/device/hid_composite_freertos/src/main.c11
-rw-r--r--examples/device/hid_composite_freertos/src/tusb_config.h2
-rw-r--r--examples/device/midi_test_freertos/src/main.c8
-rw-r--r--examples/device/net_lwip_webserver/Makefile2
-rw-r--r--examples/device/video_capture/src/main.c6
-rw-r--r--examples/device/video_capture/src/tusb_config.h2
-rw-r--r--examples/device/video_capture_2ch/src/main.c6
-rw-r--r--examples/device/video_capture_2ch/src/tusb_config.h2
-rw-r--r--examples/host/cdc_msc_hid/src/cdc_app.c5
-rw-r--r--examples/host/cdc_msc_hid_freertos/src/cdc_app.c2
-rw-r--r--examples/host/cdc_msc_hid_freertos/src/main.c8
-rw-r--r--examples/host/cdc_msc_hid_freertos/src/tusb_config.h2
-rw-r--r--examples/host/device_info/src/main.c8
-rw-r--r--examples/host/device_info/src/tusb_config.h2
-rw-r--r--examples/host/midi_rx/src/tusb_config.h2
-rw-r--r--examples/typec/power_delivery/src/main.c5
25 files changed, 79 insertions, 75 deletions
diff --git a/examples/build_system/make/make.mk b/examples/build_system/make/make.mk
index dbc73903e..f70748d34 100644
--- a/examples/build_system/make/make.mk
+++ b/examples/build_system/make/make.mk
@@ -123,27 +123,24 @@ endif
ifeq (${MAX3421_HOST},1)
SRC_C += src/portable/analog/max3421/hcd_max3421.c
CFLAGS += -DCFG_TUH_MAX3421=1
- CMAKE_DEFSYM += -DMAX3421_HOST=1
endif
# Log level is mapped to TUSB DEBUG option
ifneq ($(LOG),)
- CMAKE_DEFSYM += -DLOG=$(LOG)
CFLAGS += -DCFG_TUSB_DEBUG=$(LOG)
endif
# Logger: default is uart, can be set to rtt or swo
-ifneq ($(LOGGER),)
- CMAKE_DEFSYM += -DLOGGER=$(LOGGER)
-endif
-
ifeq ($(LOGGER),rtt)
- CFLAGS += -DLOGGER_RTT -DSEGGER_RTT_MODE_DEFAULT=SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
- RTT_SRC = lib/SEGGER_RTT
- INC += $(TOP)/$(RTT_SRC)/RTT
- SRC_C += $(RTT_SRC)/RTT/SEGGER_RTT.c
-else ifeq ($(LOGGER),swo)
+ CFLAGS += -DLOGGER_RTT
+ #CFLAGS += -DSEGGER_RTT_MODE_DEFAULT=SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
+ INC += $(TOP)/$(lib/SEGGER_RTT)/RTT
+ SRC_C += $(lib/SEGGER_RTT)/RTT/SEGGER_RTT.c
+endif
+ifeq ($(LOGGER),swo)
CFLAGS += -DLOGGER_SWO
+else
+ CFLAGS += -DLOGGER_UART
endif
# CPU specific flags
diff --git a/examples/device/audio_4_channel_mic_freertos/src/main.c b/examples/device/audio_4_channel_mic_freertos/src/main.c
index 99278b5cc..d5a34b194 100644
--- a/examples/device/audio_4_channel_mic_freertos/src/main.c
+++ b/examples/device/audio_4_channel_mic_freertos/src/main.c
@@ -39,7 +39,7 @@
#include "bsp/board_api.h"
#include "tusb.h"
-#if TUSB_MCU_VENDOR_ESPRESSIF
+#ifdef ESP_PLATFORM
// ESP-IDF need "freertos/" prefix in include path.
// CFG_TUSB_OS_INC_PATH should be defined accordingly.
#include "freertos/FreeRTOS.h"
@@ -158,17 +158,16 @@ int main(void)
xTaskCreate(audio_task, "audio", AUDIO_STACK_SIZE, NULL, configMAX_PRIORITIES - 1, NULL);
#endif
- // skip starting scheduler (and return) for ESP32-S2 or ESP32-S3
- #if !TUSB_MCU_VENDOR_ESPRESSIF
+ // only start scheduler for non-espressif mcu
+ #ifndef ESP_PLATFORM
vTaskStartScheduler();
#endif
return 0;
}
-#if TUSB_MCU_VENDOR_ESPRESSIF
-void app_main(void)
-{
+#ifdef ESP_PLATFORM
+void app_main(void) {
main();
}
#endif
diff --git a/examples/device/audio_4_channel_mic_freertos/src/tusb_config.h b/examples/device/audio_4_channel_mic_freertos/src/tusb_config.h
index 5ac51b153..f7c0efe08 100644
--- a/examples/device/audio_4_channel_mic_freertos/src/tusb_config.h
+++ b/examples/device/audio_4_channel_mic_freertos/src/tusb_config.h
@@ -59,7 +59,7 @@ extern "C" {
#endif
// Espressif IDF requires "freertos/" prefix in include path
-#if TUSB_MCU_VENDOR_ESPRESSIF
+#ifdef ESP_PLATFORM
#define CFG_TUSB_OS_INC_PATH freertos/
#endif
diff --git a/examples/device/audio_test_freertos/src/main.c b/examples/device/audio_test_freertos/src/main.c
index c5143c3fc..3831be87f 100644
--- a/examples/device/audio_test_freertos/src/main.c
+++ b/examples/device/audio_test_freertos/src/main.c
@@ -38,7 +38,7 @@
#include "bsp/board_api.h"
#include "tusb.h"
-#if TUSB_MCU_VENDOR_ESPRESSIF
+#ifdef ESP_PLATFORM
// ESP-IDF need "freertos/" prefix in include path.
// CFG_TUSB_OS_INC_PATH should be defined accordingly.
#include "freertos/FreeRTOS.h"
@@ -132,15 +132,15 @@ int main(void)
xTaskCreate(usb_device_task, "usbd", USBD_STACK_SIZE, NULL, configMAX_PRIORITIES - 1, NULL);
#endif
- // skip starting scheduler (and return) for ESP32-S2 or ESP32-S3
- #if !TUSB_MCU_VENDOR_ESPRESSIF
+ // only start scheduler for non-espressif mcu
+ #ifndef ESP_PLATFORM
vTaskStartScheduler();
#endif
return 0;
}
-#if TUSB_MCU_VENDOR_ESPRESSIF
+#ifdef ESP_PLATFORM
void app_main(void) {
main();
}
diff --git a/examples/device/audio_test_freertos/src/tusb_config.h b/examples/device/audio_test_freertos/src/tusb_config.h
index 61c5cbb96..0fb2106e2 100644
--- a/examples/device/audio_test_freertos/src/tusb_config.h
+++ b/examples/device/audio_test_freertos/src/tusb_config.h
@@ -59,7 +59,7 @@ extern "C" {
#endif
// Espressif IDF requires "freertos/" prefix in include path
-#if TUSB_MCU_VENDOR_ESPRESSIF
+#ifdef ESP_PLATFORM
#define CFG_TUSB_OS_INC_PATH freertos/
#endif
diff --git a/examples/device/board_test/src/main.c b/examples/device/board_test/src/main.c
index 2269d45f1..d91a8760e 100644
--- a/examples/device/board_test/src/main.c
+++ b/examples/device/board_test/src/main.c
@@ -49,25 +49,34 @@ int main(void) {
while (1) {
uint32_t interval_ms = board_button_read() ? BLINK_PRESSED : BLINK_UNPRESSED;
+ int ch = board_getchar();
+ if (ch > 0) {
+ board_putchar(ch);
+ #ifndef LOGGER_UART
+ board_uart_write(&ch, 1);
+ #endif
+ }
+
// Blink and print every interval ms
if (!(board_millis() - start_ms < interval_ms)) {
- board_uart_write(HELLO_STR, strlen(HELLO_STR));
-
start_ms = board_millis();
+ if (ch < 0) {
+ // skip if echoing
+ printf(HELLO_STR);
+
+ #ifndef LOGGER_UART
+ board_uart_write(HELLO_STR, strlen(HELLO_STR));
+ #endif
+ }
+
board_led_write(led_state);
led_state = 1 - led_state; // toggle
}
-
- // echo
- uint8_t ch;
- if (board_uart_read(&ch, 1) > 0) {
- board_uart_write(&ch, 1);
- }
}
}
-#if TUSB_MCU_VENDOR_ESPRESSIF
+#ifdef ESP_PLATFORM
void app_main(void) {
main();
}
diff --git a/examples/device/board_test/src/tusb_config.h b/examples/device/board_test/src/tusb_config.h
index 8ac3bc8de..81829d450 100644
--- a/examples/device/board_test/src/tusb_config.h
+++ b/examples/device/board_test/src/tusb_config.h
@@ -44,7 +44,7 @@
#endif
// Espressif IDF requires "freertos/" prefix in include path
-#if TUSB_MCU_VENDOR_ESPRESSIF
+#ifdef ESP_PLATFORM
#define CFG_TUSB_OS_INC_PATH freertos/
#endif
diff --git a/examples/device/cdc_msc_freertos/src/main.c b/examples/device/cdc_msc_freertos/src/main.c
index 4dada9801..6fe964153 100644
--- a/examples/device/cdc_msc_freertos/src/main.c
+++ b/examples/device/cdc_msc_freertos/src/main.c
@@ -30,7 +30,7 @@
#include "bsp/board_api.h"
#include "tusb.h"
-#if TUSB_MCU_VENDOR_ESPRESSIF
+#ifdef ESP_PLATFORM
#define USBD_STACK_SIZE 4096
#else
// Increase stack size when debug log is enabled
@@ -91,15 +91,15 @@ int main(void) {
xTaskCreate(cdc_task, "cdc", CDC_STACK_SZIE, NULL, configMAX_PRIORITIES - 2, NULL);
#endif
-#if !TUSB_MCU_VENDOR_ESPRESSIF
- // skip starting scheduler (and return) for ESP32-S2 or ESP32-S3
+#ifndef ESP_PLATFORM
+ // only start scheduler for non-espressif mcu
vTaskStartScheduler();
#endif
return 0;
}
-#if TUSB_MCU_VENDOR_ESPRESSIF
+#ifdef ESP_PLATFORM
void app_main(void) {
main();
}
diff --git a/examples/device/cdc_msc_freertos/src/tusb_config.h b/examples/device/cdc_msc_freertos/src/tusb_config.h
index c3f2f7fb5..71a0e985a 100644
--- a/examples/device/cdc_msc_freertos/src/tusb_config.h
+++ b/examples/device/cdc_msc_freertos/src/tusb_config.h
@@ -59,7 +59,7 @@
#endif
// Espressif IDF requires "freertos/" prefix in include path
-#if TUSB_MCU_VENDOR_ESPRESSIF
+#ifdef ESP_PLATFORM
#define CFG_TUSB_OS_INC_PATH freertos/
#endif
diff --git a/examples/device/hid_composite_freertos/src/main.c b/examples/device/hid_composite_freertos/src/main.c
index 30c0331ef..3f5e8a91c 100644
--- a/examples/device/hid_composite_freertos/src/main.c
+++ b/examples/device/hid_composite_freertos/src/main.c
@@ -31,7 +31,7 @@
#include "tusb.h"
#include "usb_descriptors.h"
-#if TUSB_MCU_VENDOR_ESPRESSIF
+#ifdef ESP_PLATFORM
// ESP-IDF need "freertos/" prefix in include path.
// CFG_TUSB_OS_INC_PATH should be defined accordingly.
#include "freertos/FreeRTOS.h"
@@ -112,17 +112,16 @@ int main(void)
xTimerStart(blinky_tm, 0);
- // skip starting scheduler (and return) for ESP32-S2 or ESP32-S3
-#if !TUSB_MCU_VENDOR_ESPRESSIF
+ // only start scheduler for non-espressif mcu
+#ifndef ESP_PLATFORM
vTaskStartScheduler();
#endif
return 0;
}
-#if TUSB_MCU_VENDOR_ESPRESSIF
-void app_main(void)
-{
+#ifdef ESP_PLATFORM
+void app_main(void) {
main();
}
#endif
diff --git a/examples/device/hid_composite_freertos/src/tusb_config.h b/examples/device/hid_composite_freertos/src/tusb_config.h
index 6ec38b95c..b28033a0c 100644
--- a/examples/device/hid_composite_freertos/src/tusb_config.h
+++ b/examples/device/hid_composite_freertos/src/tusb_config.h
@@ -59,7 +59,7 @@
#endif
// Espressif IDF requires "freertos/" prefix in include path
-#if TUSB_MCU_VENDOR_ESPRESSIF
+#ifdef ESP_PLATFORM
#define CFG_TUSB_OS_INC_PATH freertos/
#endif
diff --git a/examples/device/midi_test_freertos/src/main.c b/examples/device/midi_test_freertos/src/main.c
index dbe89080c..3e406d38d 100644
--- a/examples/device/midi_test_freertos/src/main.c
+++ b/examples/device/midi_test_freertos/src/main.c
@@ -40,7 +40,7 @@
//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF PROTYPES
//--------------------------------------------------------------------+
-#if TUSB_MCU_VENDOR_ESPRESSIF
+#ifdef ESP_PLATFORM
#define USBD_STACK_SIZE 4096
#else
// Increase stack size when debug log is enabled
@@ -95,15 +95,15 @@ int main(void) {
xTaskCreate(midi_task, "midi", MIDI_STACK_SIZE, NULL, configMAX_PRIORITIES - 2, NULL);
#endif
-#if !TUSB_MCU_VENDOR_ESPRESSIF
- // skip starting scheduler (and return) for ESP32-S2 or ESP32-S3
+#ifndef ESP_PLATFORM
+ // only start scheduler for non-espressif mcu
vTaskStartScheduler();
#endif
return 0;
}
-#if TUSB_MCU_VENDOR_ESPRESSIF
+#ifdef ESP_PLATFORM
void app_main(void) {
main();
}
diff --git a/examples/device/net_lwip_webserver/Makefile b/examples/device/net_lwip_webserver/Makefile
index 141532466..4ad110dec 100644
--- a/examples/device/net_lwip_webserver/Makefile
+++ b/examples/device/net_lwip_webserver/Makefile
@@ -1,5 +1,3 @@
-DEPS_SUBMODULES += lib/lwip
-
include ../../build_system/make/make.mk
# suppress warning caused by lwip
diff --git a/examples/device/video_capture/src/main.c b/examples/device/video_capture/src/main.c
index 04d4af4e5..0406279fd 100644
--- a/examples/device/video_capture/src/main.c
+++ b/examples/device/video_capture/src/main.c
@@ -292,7 +292,7 @@ void led_blinking_task(void* param) {
#define BLINKY_STACK_SIZE configMINIMAL_STACK_SIZE
#define VIDEO_STACK_SIZE (configMINIMAL_STACK_SIZE*4)
-#if TUSB_MCU_VENDOR_ESPRESSIF
+#ifdef ESP_PLATFORM
#define USBD_STACK_SIZE 4096
int main(void);
void app_main(void) {
@@ -351,8 +351,8 @@ void freertos_init_task(void) {
xTaskCreate(video_task, "video", VIDEO_STACK_SZIE, NULL, configMAX_PRIORITIES - 2, NULL);
#endif
- // skip starting scheduler (and return) for ESP32-S2 or ESP32-S3
- #if !TUSB_MCU_VENDOR_ESPRESSIF
+ // only start scheduler for non-espressif mcu
+ #ifndef ESP_PLATFORM
vTaskStartScheduler();
#endif
}
diff --git a/examples/device/video_capture/src/tusb_config.h b/examples/device/video_capture/src/tusb_config.h
index 6dbd6f2a5..4ba86ca65 100644
--- a/examples/device/video_capture/src/tusb_config.h
+++ b/examples/device/video_capture/src/tusb_config.h
@@ -58,7 +58,7 @@
#endif
// Espressif IDF requires "freertos/" prefix in include path
-#if TUSB_MCU_VENDOR_ESPRESSIF
+#ifdef ESP_PLATFORM
#define CFG_TUSB_OS_INC_PATH freertos/
#endif
diff --git a/examples/device/video_capture_2ch/src/main.c b/examples/device/video_capture_2ch/src/main.c
index 245e7abb8..dc616e3fa 100644
--- a/examples/device/video_capture_2ch/src/main.c
+++ b/examples/device/video_capture_2ch/src/main.c
@@ -300,7 +300,7 @@ void led_blinking_task(void* param) {
#define BLINKY_STACK_SIZE configMINIMAL_STACK_SIZE
#define VIDEO_STACK_SIZE (configMINIMAL_STACK_SIZE*4)
-#if TUSB_MCU_VENDOR_ESPRESSIF
+#ifdef ESP_PLATFORM
#define USBD_STACK_SIZE 4096
int main(void);
void app_main(void) {
@@ -359,8 +359,8 @@ void freertos_init_task(void) {
xTaskCreate(video_task, "video", VIDEO_STACK_SZIE, NULL, configMAX_PRIORITIES - 2, NULL);
#endif
- // skip starting scheduler (and return) for ESP32-S2 or ESP32-S3
- #if !TUSB_MCU_VENDOR_ESPRESSIF
+ // only start scheduler for non-espressif mcu
+ #ifndef ESP_PLATFORM
vTaskStartScheduler();
#endif
}
diff --git a/examples/device/video_capture_2ch/src/tusb_config.h b/examples/device/video_capture_2ch/src/tusb_config.h
index 91775a327..e84e49879 100644
--- a/examples/device/video_capture_2ch/src/tusb_config.h
+++ b/examples/device/video_capture_2ch/src/tusb_config.h
@@ -58,7 +58,7 @@
#endif
// Espressif IDF requires "freertos/" prefix in include path
-#if TUSB_MCU_VENDOR_ESPRESSIF
+#ifdef ESP_PLATFORM
#define CFG_TUSB_OS_INC_PATH freertos/
#endif
diff --git a/examples/host/cdc_msc_hid/src/cdc_app.c b/examples/host/cdc_msc_hid/src/cdc_app.c
index 2fa9a8560..97f1a96d6 100644
--- a/examples/host/cdc_msc_hid/src/cdc_app.c
+++ b/examples/host/cdc_msc_hid/src/cdc_app.c
@@ -72,7 +72,10 @@ void tuh_cdc_rx_cb(uint8_t idx) {
if (count) {
buf[count] = 0;
printf("%s", (char*) buf);
- fflush(stdout);
+
+ #ifndef __ICCARM__ // TODO IAR doesn't support stream control ?
+ fflush(stdout);// flush right away, else nanolib will wait for newline
+ #endif
}
}
diff --git a/examples/host/cdc_msc_hid_freertos/src/cdc_app.c b/examples/host/cdc_msc_hid_freertos/src/cdc_app.c
index e279ad509..d99760a02 100644
--- a/examples/host/cdc_msc_hid_freertos/src/cdc_app.c
+++ b/examples/host/cdc_msc_hid_freertos/src/cdc_app.c
@@ -27,7 +27,7 @@
#include "tusb.h"
#include "bsp/board_api.h"
-#if TUSB_MCU_VENDOR_ESPRESSIF
+#ifdef ESP_PLATFORM
#define CDC_STACK_SZIE 2048
#else
#define CDC_STACK_SZIE (3*configMINIMAL_STACK_SIZE/2)
diff --git a/examples/host/cdc_msc_hid_freertos/src/main.c b/examples/host/cdc_msc_hid_freertos/src/main.c
index 64a108254..0bcb355ec 100644
--- a/examples/host/cdc_msc_hid_freertos/src/main.c
+++ b/examples/host/cdc_msc_hid_freertos/src/main.c
@@ -30,7 +30,7 @@
#include "bsp/board_api.h"
#include "tusb.h"
-#if TUSB_MCU_VENDOR_ESPRESSIF
+#ifdef ESP_PLATFORM
#define USBH_STACK_SIZE 4096
#else
// Increase stack size when debug log is enabled
@@ -86,15 +86,15 @@ int main(void) {
xTimerStart(blinky_tm, 0);
- // skip starting scheduler (and return) for ESP32-S2 or ESP32-S3
-#if !TUSB_MCU_VENDOR_ESPRESSIF
+ // only start scheduler for non-espressif mcu
+#ifndef ESP_PLATFORM
vTaskStartScheduler();
#endif
return 0;
}
-#if TUSB_MCU_VENDOR_ESPRESSIF
+#ifdef ESP_PLATFORM
void app_main(void) {
main();
}
diff --git a/examples/host/cdc_msc_hid_freertos/src/tusb_config.h b/examples/host/cdc_msc_hid_freertos/src/tusb_config.h
index bc8887211..3cdb227e2 100644
--- a/examples/host/cdc_msc_hid_freertos/src/tusb_config.h
+++ b/examples/host/cdc_msc_hid_freertos/src/tusb_config.h
@@ -44,7 +44,7 @@
#endif
// Espressif IDF requires "freertos/" prefix in include path
-#if TUSB_MCU_VENDOR_ESPRESSIF
+#ifdef ESP_PLATFORM
#define CFG_TUSB_OS_INC_PATH freertos/
#endif
diff --git a/examples/host/device_info/src/main.c b/examples/host/device_info/src/main.c
index e924a137b..7189972d6 100644
--- a/examples/host/device_info/src/main.c
+++ b/examples/host/device_info/src/main.c
@@ -268,7 +268,7 @@ void led_blinking_task(void* param) {
#define BLINKY_STACK_SIZE configMINIMAL_STACK_SIZE
-#if TUSB_MCU_VENDOR_ESPRESSIF
+#ifdef ESP_PLATFORM
#define USB_STACK_SIZE 4096
#else
// Increase stack size when debug log is enabled
@@ -285,7 +285,7 @@ StackType_t usb_stack[USB_STACK_SIZE];
StaticTask_t usb_taskdef;
#endif
-#if TUSB_MCU_VENDOR_ESPRESSIF
+#ifdef ESP_PLATFORM
void app_main(void) {
main();
}
@@ -308,8 +308,8 @@ void init_freertos_task(void) {
xTaskCreate(usb_host_task, "usbh", USB_STACK_SIZE, NULL, configMAX_PRIORITIES - 1, NULL);
#endif
- // skip starting scheduler (and return) for ESP32-S2 or ESP32-S3
-#if !TUSB_MCU_VENDOR_ESPRESSIF
+ // only start scheduler for non-espressif mcu
+#ifndef ESP_PLATFORM
vTaskStartScheduler();
#endif
}
diff --git a/examples/host/device_info/src/tusb_config.h b/examples/host/device_info/src/tusb_config.h
index e12970c12..e4ca2528e 100644
--- a/examples/host/device_info/src/tusb_config.h
+++ b/examples/host/device_info/src/tusb_config.h
@@ -40,7 +40,7 @@
#endif
// Espressif IDF requires "freertos/" prefix in include path
-#if TUSB_MCU_VENDOR_ESPRESSIF
+#ifdef ESP_PLATFORM
#define CFG_TUSB_OS_INC_PATH freertos/
#endif
diff --git a/examples/host/midi_rx/src/tusb_config.h b/examples/host/midi_rx/src/tusb_config.h
index c9b430388..76bdf87f3 100644
--- a/examples/host/midi_rx/src/tusb_config.h
+++ b/examples/host/midi_rx/src/tusb_config.h
@@ -40,7 +40,7 @@ extern "C" {
#endif
// Espressif IDF requires "freertos/" prefix in include path
-#if TUSB_MCU_VENDOR_ESPRESSIF
+#ifdef ESP_PLATFORM
#define CFG_TUSB_OS_INC_PATH freertos/
#endif
diff --git a/examples/typec/power_delivery/src/main.c b/examples/typec/power_delivery/src/main.c
index 068dbbeb1..de0db4721 100644
--- a/examples/typec/power_delivery/src/main.c
+++ b/examples/typec/power_delivery/src/main.c
@@ -71,9 +71,8 @@ int main(void)
}
}
-#if TUSB_MCU_VENDOR_ESPRESSIF
-void app_main(void)
-{
+#ifdef ESP_PLATFORM
+void app_main(void) {
main();
}
#endif