File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,19 @@ def _update_max_upload_size(env):
122
122
env .BoardConfig ().update ("upload.maximum_size" , ldsizes ['app_size' ])
123
123
124
124
125
+ def get_esptoolpy_reset_flags (resetmethod ):
126
+ # no dtr, no_sync
127
+ resets = ("no_reset_no_sync" , "soft_reset" )
128
+ if resetmethod == "nodemcu" :
129
+ # dtr
130
+ resets = ("default_reset" , "hard_reset" )
131
+ elif resetmethod == "ck" :
132
+ # no dtr
133
+ resets = ("no_reset" , "soft_reset" )
134
+
135
+ return ["--before" , resets [0 ], "--after" , resets [1 ]]
136
+
137
+
125
138
########################################################
126
139
127
140
env = DefaultEnvironment ()
@@ -305,6 +318,10 @@ def _update_max_upload_size(env):
305
318
UPLOADCMD = '"$PYTHONEXE" "$UPLOADER" $UPLOADERFLAGS $SOURCE' ,
306
319
)
307
320
321
+ env .Prepend (
322
+ UPLOADERFLAGS = get_esptoolpy_reset_flags (env .subst ("$UPLOAD_RESETMETHOD" ))
323
+ )
324
+
308
325
upload_actions = [
309
326
env .VerboseAction (env .AutodetectUploadPort ,
310
327
"Looking for upload port..." ),
You can’t perform that action at this time.
0 commit comments