board might auto reset on firmware hash change
This commit is contained in:
18
index.html
18
index.html
@@ -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!");
|
||||
|
||||
Reference in New Issue
Block a user