@@ -115,7 +115,7 @@ def install_tool(TOOL):
115
115
if mcu == "esp32c2" :
116
116
self .packages ["framework-arduino-c2-skeleton-lib" ]["optional" ] = False
117
117
118
- mcu_toolchain_mapping = {
118
+ MCU_TOOLCHAIN_MAPPING = {
119
119
# Xtensa based and FSM toolchain
120
120
("esp32" , "esp32s2" , "esp32s3" ): {
121
121
"toolchains" : ["toolchain-xtensa-esp-elf" ],
@@ -129,9 +129,8 @@ def install_tool(TOOL):
129
129
"debug_tools" : ["tool-riscv32-esp-elf-gdb" ]
130
130
}
131
131
}
132
-
133
132
# Iterate through MCU mappings
134
- for supported_mcus , toolchain_data in mcu_toolchain_mapping .items ():
133
+ for supported_mcus , toolchain_data in MCU_TOOLCHAIN_MAPPING .items ():
135
134
if mcu in supported_mcus :
136
135
# Set mandatory toolchains
137
136
for toolchain in toolchain_data ["toolchains" ]:
@@ -160,10 +159,17 @@ def install_tool(TOOL):
160
159
for package in COMMON_IDF_PACKAGES :
161
160
self .packages [package ]["optional" ] = False
162
161
163
- # Enable check tools only when "check_tool" is active
164
- for p in self .packages :
165
- if p in ("tool-cppcheck" , "tool-clangtidy" , "tool-pvs-studio" ):
166
- self .packages [p ]["optional" ] = False if str (variables .get ("check_tool" )).strip ("['']" ) in p else True
162
+ CHECK_PACKAGES = [
163
+ "tool-cppcheck" ,
164
+ "tool-clangtidy" ,
165
+ "tool-pvs-studio"
166
+ ]
167
+ # Install check tool listed in pio entry "check_tool"
168
+ if variables .get ("check_tool" ) is not None :
169
+ for package in CHECK_PACKAGES :
170
+ for check_tool in variables .get ("check_tool" , "" ):
171
+ if check_tool in package :
172
+ self .packages [package ]["optional" ] = False
167
173
168
174
if "buildfs" in targets :
169
175
filesystem = variables .get ("board_build.filesystem" , "littlefs" )
@@ -226,7 +232,6 @@ def _add_dynamic_options(self, board):
226
232
# A special case for the Kaluga board that has a separate interface config
227
233
if board .id == "esp32-s2-kaluga-1" :
228
234
supported_debug_tools .append ("ftdi" )
229
-
230
235
if board .get ("build.mcu" , "" ) in ("esp32c3" , "esp32c5" , "esp32c6" , "esp32s3" , "esp32h2" , "esp32p4" ):
231
236
supported_debug_tools .append ("esp-builtin" )
232
237
0 commit comments