Fix error when flashing with uf2conv.py
This commit is contained in:
parent
c686c5a2e1
commit
2f07f37391
1 changed files with 7 additions and 4 deletions
|
@ -246,10 +246,13 @@ def list_drives():
|
|||
|
||||
|
||||
def write_file(name, buf):
|
||||
try:
|
||||
with open(name, "wb") as f:
|
||||
f.write(buf)
|
||||
print("Wrote %d bytes to %s" % (len(buf), name))
|
||||
|
||||
except IOError as e:
|
||||
print(f"Failed to write to {name}: {e}")
|
||||
print("Still may have wrote %d bytes to %s" % (len(buf), name))
|
||||
|
||||
def load_families():
|
||||
# The expectation is that the `uf2families.json` file is in the same
|
||||
|
|
Loading…
Add table
Reference in a new issue