Skip to content

Commit 4e256f9

Browse files
Added comments to better explain BSP installation flow
1 parent 1edd78e commit 4e256f9

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

examples/person_detection/CMakeLists.txt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,28 @@ cmake_minimum_required(VERSION 3.5)
33
set(EXTRA_COMPONENT_DIRS static_images)
44
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
55

6+
# Helper function to set required environment variables as per configuration set by user
67
function(add_bsp SDKCONFIG BSP)
78
string(REGEX MATCH "CONFIG_${BSP}=y" REGEX_RESULT ${SDKCONFIG})
89
if (REGEX_RESULT)
9-
set(ENV{${BSP}} 1)
10+
set(ENV{${BSP}} 1) # If the config option is set then set corresponding environment variable to 1
1011
endif()
1112
endfunction()
1213

13-
# 1. Define all variables used in main/idf_component.yml
14+
# 1. Define all variables used in main/idf_component.yml and set them to zero
1415
set(ENV{TFLITE_USE_BSP_S3_EYE} 0)
1516
set(ENV{TFLITE_USE_BSP_KORVO_2} 0)
1617
set(ENV{TFLITE_USE_BSP_KALUGA} 0)
1718

18-
# 2. Set correct var to 'target'
19+
# 2. Set correct var to 1
1920
# This is a workaround idf-component-manager limitation, where only
20-
# target and idf_version can be in the if-clause
21+
# target, idf_version and environment variables can be in the if-clause
2122
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/sdkconfig)
2223
file(READ ${CMAKE_CURRENT_LIST_DIR}/sdkconfig SDKCONFIG_RULE)
2324

24-
add_bsp("${SDKCONFIG_RULE}" "TFLITE_USE_BSP_S3_EYE")
25-
add_bsp("${SDKCONFIG_RULE}" "TFLITE_USE_BSP_KORVO_2")
26-
add_bsp("${SDKCONFIG_RULE}" "TFLITE_USE_BSP_KALUGA")
25+
add_bsp("${SDKCONFIG_RULE}" "TFLITE_USE_BSP_S3_EYE") # Check for CONFIG_TFLITE_USE_BSP_S3_EYE option in sdkconfig
26+
add_bsp("${SDKCONFIG_RULE}" "TFLITE_USE_BSP_KORVO_2") # Check for CONFIG_TFLITE_USE_BSP_KORVO_2 option in sdkconfig
27+
add_bsp("${SDKCONFIG_RULE}" "TFLITE_USE_BSP_KALUGA") # Check for CONFIG_TFLITE_USE_BSP_KALUGA option in sdkconfig
2728
endif()
2829

2930
project(person_detection)

0 commit comments

Comments
 (0)