update esp build, replace TUSB_MCU_VENDOR_ESPRESSIF by ESP_PLATFORM

This commit is contained in:
hathach
2025-07-02 15:32:12 +07:00
parent 4579b4f825
commit 0388700ad7
27 changed files with 64 additions and 61 deletions

View File

@@ -66,7 +66,6 @@ int sys_read(int fhdl, char *buf, size_t count) {
#elif defined(LOGGER_SWO)
#define ITM_BASE 0xE0000000
#define ITM_STIM0 (*((volatile uint8_t*)(ITM_BASE + 0)))
#define ITM_TER *((volatile uint32_t*)(ITM_BASE + 0xE00))
#define ITM_TCR *((volatile uint32_t*)(ITM_BASE + 0xE80))
@@ -150,6 +149,9 @@ int board_getchar(void) {
return (sys_read(0, &c, 1) > 0) ? (int) c : (-1);
}
void board_putchar(int c) {
sys_write(0, (const char*)&c, 1);
}
uint32_t tusb_time_millis_api(void) {
return board_millis();
@@ -158,7 +160,7 @@ uint32_t tusb_time_millis_api(void) {
//--------------------------------------------------------------------
// FreeRTOS hooks
//--------------------------------------------------------------------
#if CFG_TUSB_OS == OPT_OS_FREERTOS && !TUSB_MCU_VENDOR_ESPRESSIF
#if CFG_TUSB_OS == OPT_OS_FREERTOS && !defined(ESP_PLATFORM)
#include "FreeRTOS.h"
#include "task.h"
@@ -240,5 +242,4 @@ void vApplicationSetupTimerInterrupt(void) {
}
#endif
#endif

View File

@@ -41,7 +41,7 @@ extern "C" {
#if CFG_TUSB_OS == OPT_OS_ZEPHYR
#include <zephyr/kernel.h>
#elif CFG_TUSB_OS == OPT_OS_FREERTOS
#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"
@@ -195,6 +195,7 @@ static inline void board_delay(uint32_t ms) {
// stdio getchar() is blocking, this is non-blocking version
int board_getchar(void);
void board_putchar(int c);
#ifdef __cplusplus
}

View File

@@ -156,6 +156,10 @@ int board_getchar(void) {
return getchar();
}
void board_putchar(int c) {
putchar(c);
}
//--------------------------------------------------------------------
// PHY Init
//--------------------------------------------------------------------