esp32p4 use port0 as fs, port1 as highspeed

This commit is contained in:
hathach
2024-09-27 15:32:47 +07:00
parent 67e5577b42
commit 87f1993304
6 changed files with 52 additions and 45 deletions

View File

@@ -4,5 +4,3 @@ idf_component_register(SRCS family.c
INCLUDE_DIRS "." ${BOARD} ${hw_dir}
PRIV_REQUIRES driver usb
REQUIRES led_strip src tinyusb_src)
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-error=format)

View File

@@ -9,6 +9,9 @@ string(TOUPPER OPT_MCU_${target} tusb_mcu)
list(APPEND compile_definitions
CFG_TUSB_MCU=${tusb_mcu}
CFG_TUSB_OS=OPT_OS_FREERTOS
# EXAMPLE port selection: port0 is fullspeed, port1 is highspeed
BOARD_TUD_RHPORT=${TUD_PORT}
BOARD_TUD_MAX_SPEED=$<IF:${TUD_PORT},OPT_MODE_HIGH_SPEED,OPT_MODE_FULL_SPEED>
)
list(APPEND srcs

View File

@@ -2,9 +2,17 @@ cmake_minimum_required(VERSION 3.5)
# Apply board specific content i.e IDF_TARGET must be set before project.cmake is included
include("${CMAKE_CURRENT_LIST_DIR}/boards/${BOARD}/board.cmake")
string(TOUPPER ${IDF_TARGET} FAMILY_MCUS)
# Device port default to Port1 for P4 (highspeed), Port0 for others (fullspeed)
if (NOT DEFINED TUD_PORT)
if (IDF_TARGET STREQUAL "esp32p4")
set(TUD_PORT 1)
else ()
set(TUD_PORT 0)
endif ()
endif()
# Add example src and bsp directories
set(EXTRA_COMPONENT_DIRS "src" "${CMAKE_CURRENT_LIST_DIR}/boards" "${CMAKE_CURRENT_LIST_DIR}/components")