1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-18 00:03:07 +01:00

intermediate: handle flusing of s3 images in webinstaller

This commit is contained in:
andreas
2023-09-09 13:01:00 +02:00
parent e8c6a72a43
commit 4fcf6b753f
2 changed files with 37 additions and 15 deletions

View File

@@ -235,22 +235,21 @@ class ESPInstaller{
* @param {*} user
* @param {*} repo
* @param {*} version
* @param {*} address
* @param {*} assetName
* @param {*} checkChip will be called with the found chip and the data and the isFull flag
* must return an info with the flashStart being set
* @returns
*/
async installClicked(isFull, user, repo, version, address, assetName) {
async installClicked(isFull, user, repo, version, assetName,checkChip) {
try {
await this.connect();
let imageData = await this.getReleaseAsset(user, repo, version, assetName);
if (!imageData || imageData.length == 0) {
throw new Error(`no image data fetched`);
}
if (checkChip) {
await checkChip(this.getChipFamily(),imageData,isFull);
}
let info=await checkChip(this.getChipFamily(),imageData,isFull);
let fileList = [
{ data: imageData, address: address }
{ data: imageData, address: info.flashAddress }
];
let txt = isFull ? "baseImage (all data will be erased)" : "update";
if (!confirm(`ready to install ${version}\n${txt}`)) {