File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 58
58
if cfg .startswith (CFG_TARGET + '=' ):
59
59
target_chip = cfg [len (CFG_TARGET ) + 1 :]
60
60
61
- # Backup existing sdkconfig.default file
61
+ # Backup/remove existing sdkconfig files
62
62
if os .path .isfile ('./sdkconfig.defaults' ):
63
63
os .rename ('./sdkconfig.defaults' , './sdkconfig.defaults.orig' )
64
+ if os .path .isfile ('./sdkconfig' ):
65
+ os .remove ('./sdkconfig' )
66
+
67
+ subprocess .check_call (f'idf.py set-target { target_chip } ' , shell = True )
68
+
69
+ # Remove recreated sdkconfig files
70
+ if os .path .isfile ('./sdkconfig.defaults' ):
71
+ os .remove ('./sdkconfig.defaults' )
72
+ if os .path .isfile ('./sdkconfig' ):
73
+ os .remove ('./sdkconfig' )
64
74
65
75
# Process tempfile with 'idf.py reconfigure write-defconfig' to create new sdkconfig.defaults
66
- subprocess .check_call (f'idf.py set-target { target_chip } && rm -f sdkconfig sdkconfig.defaults' ,
67
- shell = True )
68
76
subprocess .check_call (f'idf.py -D SDKCONFIG_DEFAULTS="{ TEMPFILE } " reconfigure save-defconfig' ,
69
77
shell = True )
70
78
You can’t perform that action at this time.
0 commit comments