board might auto reset on firmware hash change

This commit is contained in:
liamcottle
2024-07-16 23:19:27 +12:00
parent 2f0b7c60bd
commit f3c873fdc4

View File

@@ -455,26 +455,20 @@
return;
}
// log old hashes
console.log({
old_firmware_hash: await rnode.getFirmwareHash(),
old_target_firmware_hash: await rnode.getTargetFirmwareHash(),
});
// todo: this works, but we should be calculating the firmware hash from the file, and not giving the board what it already knows
await rnode.setFirmwareHash(await rnode.getFirmwareHash());
// wait a bit for eeprom writes to complete
await Utils.sleepMillis(5000);
// log new hashes
console.log({
new_firmware_hash: await rnode.getFirmwareHash(),
new_target_firmware_hash: await rnode.getTargetFirmwareHash(),
});
// reset board if it didn't do it automatically
try {
await rnode.reset();
} catch(e) {
console.log("couldn't auto reset board, probably did it automatically...");
}
// done
await rnode.reset();
await rnode.close();
alert("firmware hash has been set!");