board might auto reset on firmware hash change
This commit is contained in:
18
index.html
18
index.html
@@ -455,26 +455,20 @@
|
|||||||
return;
|
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
|
// 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());
|
await rnode.setFirmwareHash(await rnode.getFirmwareHash());
|
||||||
|
|
||||||
// wait a bit for eeprom writes to complete
|
// wait a bit for eeprom writes to complete
|
||||||
await Utils.sleepMillis(5000);
|
await Utils.sleepMillis(5000);
|
||||||
|
|
||||||
// log new hashes
|
// reset board if it didn't do it automatically
|
||||||
console.log({
|
try {
|
||||||
new_firmware_hash: await rnode.getFirmwareHash(),
|
await rnode.reset();
|
||||||
new_target_firmware_hash: await rnode.getTargetFirmwareHash(),
|
} catch(e) {
|
||||||
});
|
console.log("couldn't auto reset board, probably did it automatically...");
|
||||||
|
}
|
||||||
|
|
||||||
// done
|
// done
|
||||||
await rnode.reset();
|
|
||||||
await rnode.close();
|
await rnode.close();
|
||||||
|
|
||||||
alert("firmware hash has been set!");
|
alert("firmware hash has been set!");
|
||||||
|
|||||||
Reference in New Issue
Block a user