Revert "fbt - fix flash usb without resources "

This reverts commit ce173fd44c.
This commit is contained in:
MX 2022-10-14 01:31:44 +03:00
parent 89a4b77e73
commit 6442caa3e4
No known key found for this signature in database
GPG key ID: 6C4C311DFD4B4AB5

View file

@ -80,7 +80,6 @@ class Main(App):
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
@ -116,7 +115,7 @@ class Main(App):
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_arg:
if radiobin_basename:
shutil.copyfile(
self.args.radiobin, join(self.args.directory, radiobin_basename)
)
@ -156,13 +155,10 @@ class Main(App):
file.writeComment("little-endian hex!")
file.writeKey("Loader CRC", self.int2ffhex(self.crc(self.args.stage)))
file.writeKey("Firmware", dfu_basename)
if radiobin_basename_arg:
file.writeKey("Radio", radiobin_basename)
else:
file.writeKey("Radio", "")
file.writeKey("Radio", radiobin_basename or "")
file.writeKey("Radio address", self.int2ffhex(radio_addr))
file.writeKey("Radio version", self.int2ffhex(radio_version, 12))
if radiobin_basename_arg:
if radiobin_basename:
file.writeKey("Radio CRC", self.int2ffhex(self.crc(self.args.radiobin)))
else:
file.writeKey("Radio CRC", self.int2ffhex(0))