@@ -155,10 +155,14 @@ def _get_installed_standard_pip_packages():
155
155
):
156
156
print ("Warning! Debugging an IDF project requires PlatformIO Core >= 6.1.11!" )
157
157
158
- # Arduino framework as a component is not compatible with ESP-IDF >5.3
159
158
if "arduino" in env .subst ("$PIOFRAMEWORK" ):
160
159
ARDUINO_FRAMEWORK_DIR = platform .get_package_dir ("framework-arduinoespressif32" )
161
160
ARDUINO_FRMWRK_LIB_DIR = platform .get_package_dir ("framework-arduinoespressif32-libs" )
161
+ if mcu == "esp32c2" :
162
+ ARDUINO_FRMWRK_C2_LIB_DIR = join (platform .get_package_dir ("framework-arduinoespressif32-libs" ),mcu )
163
+ if not os .path .exists (ARDUINO_FRMWRK_C2_LIB_DIR ):
164
+ ARDUINO_C2_DIR = join (platform .get_package_dir ("framework-arduino-c2-skeleton-lib" ),mcu )
165
+ shutil .copytree (ARDUINO_C2_DIR , ARDUINO_FRMWRK_C2_LIB_DIR , dirs_exist_ok = True )
162
166
# Possible package names in 'package@version' format is not compatible with CMake
163
167
if "@" in os .path .basename (ARDUINO_FRAMEWORK_DIR ):
164
168
new_path = os .path .join (
@@ -296,7 +300,7 @@ def HandleCOMPONENTsettings(env):
296
300
if flag_custom_component_add == True or flag_custom_component_remove == True : # todo remove duplicated
297
301
import yaml
298
302
from yaml import SafeLoader
299
- print ("*** \" custom_component\" is used to select managed idf components ***" )
303
+ print ("*** \" custom_component\" is used to (de) select managed idf components ***" )
300
304
if flag_custom_component_remove == True :
301
305
idf_custom_component_remove = env .GetProjectOption ("custom_component_remove" ).splitlines ()
302
306
else :
@@ -365,7 +369,7 @@ def HandleCOMPONENTsettings(env):
365
369
if flag_custom_component_add == True or flag_custom_component_remove == True :
366
370
HandleCOMPONENTsettings (env )
367
371
368
- if flag_custom_sdkonfig == True and "arduino" in env .subst ("$PIOFRAMEWORK" ):
372
+ if flag_custom_sdkonfig == True and "arduino" in env .subst ("$PIOFRAMEWORK" ) and "espidf" not in env . subst ( "$PIOFRAMEWORK" ) :
369
373
HandleArduinoIDFsettings (env )
370
374
LIB_SOURCE = os .path .join (ProjectConfig .get_instance ().get ("platformio" , "platforms_dir" ), "espressif32" , "builder" , "build_lib" )
371
375
if not bool (os .path .exists (os .path .join (PROJECT_DIR , ".dummy" ))):
@@ -2092,7 +2096,7 @@ def _skip_prj_source_files(node):
2092
2096
# Compile Arduino IDF sources
2093
2097
#
2094
2098
2095
- if "arduino" in env .get ( " PIOFRAMEWORK" ) and "espidf" not in env .get ( " PIOFRAMEWORK" ):
2099
+ if ( "arduino" in env .subst ( "$ PIOFRAMEWORK" )) and ( "espidf" not in env .subst ( "$ PIOFRAMEWORK") ):
2096
2100
def idf_lib_copy (source , target , env ):
2097
2101
env_build = join (env ["PROJECT_BUILD_DIR" ],env ["PIOENV" ])
2098
2102
sdkconfig_h_path = join (env_build ,"config" ,"sdkconfig.h" )
@@ -2150,7 +2154,7 @@ def idf_lib_copy(source, target, env):
2150
2154
print ("*** Original Arduino \" idf_component.yml\" couldnt be restored ***" )
2151
2155
env .AddPostAction ("checkprogsize" , idf_lib_copy )
2152
2156
2153
- if "espidf" in env .get ( " PIOFRAMEWORK" ) and (flag_custom_component_add == True or flag_custom_component_remove == True ):
2157
+ if "espidf" in env .subst ( "$ PIOFRAMEWORK" ) and (flag_custom_component_add == True or flag_custom_component_remove == True ):
2154
2158
def idf_custom_component (source , target , env ):
2155
2159
try :
2156
2160
shutil .copy (join (ARDUINO_FRAMEWORK_DIR ,"idf_component.yml.orig" ),join (ARDUINO_FRAMEWORK_DIR ,"idf_component.yml" ))
0 commit comments