mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-22 20:43:07 +00:00
fbt - fix flash usb without resources
this is not "stolen" from official, bug are present in ofw at current moment
This commit is contained in:
parent
d547307357
commit
ce173fd44c
1 changed files with 7 additions and 3 deletions
|
@ -80,6 +80,7 @@ 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
|
||||
|
@ -115,7 +116,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:
|
||||
if radiobin_basename_arg:
|
||||
shutil.copyfile(
|
||||
self.args.radiobin, join(self.args.directory, radiobin_basename)
|
||||
)
|
||||
|
@ -155,10 +156,13 @@ class Main(App):
|
|||
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))
|
||||
|
|
Loading…
Reference in a new issue