mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2025-12-18 00:03:07 +01:00
intermediate: prepare custom install in webinstaller
This commit is contained in:
@@ -268,6 +268,36 @@ class ESPInstaller{
|
||||
alert(`Error: ${e}`);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* directly run the flash
|
||||
* @param {*} isFull
|
||||
* @param {*} address
|
||||
* @param {*} imageData the data to be flashed
|
||||
* @param {*} version the info shown in the dialog
|
||||
* @returns
|
||||
*/
|
||||
async runFlash(isFull,address,imageData,version,assetName){
|
||||
try {
|
||||
await this.connect();
|
||||
if (typeof (assetName) === 'function') {
|
||||
assetName(this.getChipFamily()); //just check
|
||||
}
|
||||
let fileList = [
|
||||
{ data: imageData, address: address }
|
||||
];
|
||||
let txt = isFull ? "baseImage (all data will be erased)" : "update";
|
||||
if (!confirm(`ready to install ${version}\n${txt}`)) {
|
||||
this.espLoaderTerminal.writeLine("aborted by user...");
|
||||
await this.disconnect();
|
||||
return;
|
||||
}
|
||||
await this.writeFlash(fileList);
|
||||
await this.disconnect();
|
||||
} catch (e) {
|
||||
this.espLoaderTerminal.writeLine(`Error: ${e}`);
|
||||
alert(`Error: ${e}`);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* fetch the release info from the github API
|
||||
* @param {*} user
|
||||
|
||||
Reference in New Issue
Block a user