Updater: Write functional ram code loader

Updater RAM Code
----------------
* Ack running watchdog every 250 ms
* Blink green LED every 250 ms

Firmware
--------
* Add RAM code loader
* Reorganize initialization
* Add update command to shell
This commit is contained in:
2020-12-14 20:29:51 +01:00
parent 0d861b1aed
commit 963b1e106c
16 changed files with 12271 additions and 15 deletions

View File

@@ -18,6 +18,9 @@ with open(source_file, "rb") as src:
data = src.read()
with open(dest_file, "w") as dest:
header_guard = "__" + dest_file.replace('.', '_').replace('-', '_') + "_H__"
dest.write("#ifndef %s\n" % (header_guard))
dest.write("#define %s\n" % (header_guard))
dest.write("static const char binary_blob[%d] = {\n" % (len(data)))
for current,idx in zip(data, range(len(data))):
if ((idx+1) % 4 == 0):
@@ -26,5 +29,6 @@ with open(dest_file, "w") as dest:
dest.write(hex(current)+",")
dest.write("};\n")
dest.write("#endif /* %s */\n" % (header_guard))
sys.exit(0)