Skip to content

Commit 9177e55

Browse files
committed
Inline delay function
1 parent 97b862c commit 9177e55

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

builder/main.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,6 @@ def _update_max_upload_size(env):
256256
env.VerboseAction("$SIZEPRINTCMD", "Calculating size $SOURCE"))
257257
AlwaysBuild(target_size)
258258

259-
def DelayBeforeUpload(target, source, env): # pylint: disable=W0613,W0621
260-
time.sleep(0.5)
261-
262259
def RebootPico(target, source, env):
263260
time.sleep(0.5)
264261
env.Execute(
@@ -319,7 +316,8 @@ def UploadUF2ToDisk(target, source, env):
319316

320317
# picotool seems to need just a tiny bit of delay, but rp2040 load not..
321318
if "uploadfs" in COMMAND_LINE_TARGETS:
322-
upload_actions.insert(1, env.VerboseAction(DelayBeforeUpload, "Delaying a tiny bit..."))
319+
upload_actions.insert(1, env.VerboseAction(
320+
lambda source, target, env: time.sleep(0.5), "Delaying a tiny bit..."))
323321
# reboot after filesystem upload
324322
upload_actions.append(env.VerboseAction(RebootPico, "Rebooting device..."))
325323

0 commit comments

Comments
 (0)