2023-03-30 00:31:26 +07:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
|
|
|
|
2023-03-30 11:37:36 +07:00
|
|
|
# Apply board specific content i.e IDF_TARGET must be set before project.cmake is included
|
2023-03-30 00:31:26 +07:00
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/boards/${BOARD}/board.cmake")
|
2024-04-25 20:23:40 +07:00
|
|
|
string(TOUPPER ${IDF_TARGET} FAMILY_MCUS)
|
2023-04-03 17:44:05 +07:00
|
|
|
|
2024-09-27 15:32:47 +07:00
|
|
|
# Device port default to Port1 for P4 (highspeed), Port0 for others (fullspeed)
|
2024-11-07 16:37:33 +07:00
|
|
|
set(RHPORT_SPEED OPT_MODE_FULL_SPEED OPT_MODE_HIGH_SPEED)
|
|
|
|
|
|
|
|
if (NOT DEFINED RHPORT_DEVICE)
|
2024-09-27 15:32:47 +07:00
|
|
|
if (IDF_TARGET STREQUAL "esp32p4")
|
2024-11-07 16:37:33 +07:00
|
|
|
set(RHPORT_DEVICE 1)
|
2024-09-27 15:32:47 +07:00
|
|
|
else ()
|
2024-11-07 16:37:33 +07:00
|
|
|
set(RHPORT_DEVICE 0)
|
2024-11-08 17:23:43 +07:00
|
|
|
endif ()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (NOT DEFINED RHPORT_HOST)
|
|
|
|
if (IDF_TARGET STREQUAL "esp32p4")
|
|
|
|
set(RHPORT_HOST 1)
|
|
|
|
else ()
|
2024-11-07 16:37:33 +07:00
|
|
|
set(RHPORT_HOST 0)
|
2024-09-27 15:32:47 +07:00
|
|
|
endif ()
|
|
|
|
endif()
|
|
|
|
|
2024-11-07 16:37:33 +07:00
|
|
|
if (NOT DEFINED RHPORT_DEVICE_SPEED)
|
|
|
|
list(GET RHPORT_SPEED ${RHPORT_DEVICE} RHPORT_DEVICE_SPEED)
|
|
|
|
endif ()
|
|
|
|
if (NOT DEFINED RHPORT_HOST_SPEED)
|
|
|
|
list(GET RHPORT_SPEED ${RHPORT_HOST} RHPORT_HOST_SPEED)
|
|
|
|
endif ()
|
|
|
|
|
2023-03-30 00:31:26 +07:00
|
|
|
# Add example src and bsp directories
|
|
|
|
set(EXTRA_COMPONENT_DIRS "src" "${CMAKE_CURRENT_LIST_DIR}/boards" "${CMAKE_CURRENT_LIST_DIR}/components")
|
|
|
|
|
2024-09-25 20:36:16 +07:00
|
|
|
# set SDKCONFIG for each IDF Target
|
|
|
|
set(SDKCONFIG ${CMAKE_SOURCE_DIR}/sdkconfig.${IDF_TARGET})
|
|
|
|
|
2023-03-30 00:31:26 +07:00
|
|
|
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|