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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user