[FL-2052] New build system based on scons (#1269)

This commit is contained in:
hedger
2022-06-26 15:00:03 +03:00
committed by GitHub
parent c79fb61909
commit f3b1475ede
179 changed files with 3986 additions and 5196 deletions

View File

@@ -149,8 +149,10 @@ class Main(App):
self.logger.info(f"Generating OTP")
self._processFirstArgs()
self._processSecondArgs()
open(f"{self.args.file}_first.bin", "wb").write(self._packFirst())
open(f"{self.args.file}_second.bin", "wb").write(self._packSecond())
with open(f"{self.args.file}_first.bin", "wb") as file:
file.write(self._packFirst())
with open(f"{self.args.file}_second.bin", "wb") as file:
file.write(self._packSecond())
self.logger.info(
f"Generated files: {self.args.file}_first.bin and {self.args.file}_second.bin"
)
@@ -166,9 +168,9 @@ class Main(App):
try:
self.logger.info(f"Packing binary data")
file = open(filename, "wb")
file.write(self._packFirst())
file.close()
with open(filename, "wb") as file:
file.write(self._packFirst())
self.logger.info(f"Flashing OTP")
cp = CubeProgrammer(self._getCubeParams())
cp.flashBin("0x1FFF7000", filename)
@@ -190,9 +192,9 @@ class Main(App):
try:
self.logger.info(f"Packing binary data")
file = open(filename, "wb")
file.write(self._packSecond())
file.close()
with open(filename, "wb") as file:
file.write(self._packSecond())
self.logger.info(f"Flashing OTP")
cp = CubeProgrammer(self._getCubeParams())
cp.flashBin("0x1FFF7010", filename)
@@ -215,10 +217,10 @@ class Main(App):
try:
self.logger.info(f"Packing binary data")
file = open(filename, "wb")
file.write(self._packFirst())
file.write(self._packSecond())
file.close()
with open(filename, "wb") as file:
file.write(self._packFirst())
file.write(self._packSecond())
self.logger.info(f"Flashing OTP")
cp = CubeProgrammer(self._getCubeParams())
cp.flashBin("0x1FFF7000", filename)