Skip to content

Commit

Permalink
fbt - fix flash usb without resources
Browse files Browse the repository at this point in the history
this is not "stolen" from official, bug are present in ofw at current moment
  • Loading branch information
xMasterX committed Oct 13, 2022
1 parent d547307 commit ce173fd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripts/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def generate(self):
stage_basename = "updater.bin" # used to be basename(self.args.stage)
dfu_basename = "firmware.dfu" # used to be basename(self.args.dfu)
radiobin_basename = "radio.bin" # used to be basename(self.args.radiobin)
radiobin_basename_arg = basename(self.args.radiobin)
resources_basename = ""

radio_version = 0
Expand Down Expand Up @@ -115,7 +116,7 @@ def generate(self):
if self.args.dfu:
dfu_size = os.stat(self.args.dfu).st_size
shutil.copyfile(self.args.dfu, join(self.args.directory, dfu_basename))
if radiobin_basename:
if radiobin_basename_arg:
shutil.copyfile(
self.args.radiobin, join(self.args.directory, radiobin_basename)
)
Expand Down Expand Up @@ -155,10 +156,13 @@ def generate(self):
file.writeComment("little-endian hex!")
file.writeKey("Loader CRC", self.int2ffhex(self.crc(self.args.stage)))
file.writeKey("Firmware", dfu_basename)
file.writeKey("Radio", radiobin_basename or "")
if radiobin_basename_arg:
file.writeKey("Radio", radiobin_basename)
else:
file.writeKey("Radio", "")
file.writeKey("Radio address", self.int2ffhex(radio_addr))
file.writeKey("Radio version", self.int2ffhex(radio_version, 12))
if radiobin_basename:
if radiobin_basename_arg:
file.writeKey("Radio CRC", self.int2ffhex(self.crc(self.args.radiobin)))
else:
file.writeKey("Radio CRC", self.int2ffhex(0))
Expand Down

0 comments on commit ce173fd

Please sign in to comment.