show flashing errors
This commit is contained in:
26
index.html
26
index.html
@@ -112,17 +112,25 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// flash file
|
// update progress
|
||||||
this.isFlashing = true;
|
this.isFlashing = true;
|
||||||
this.progress = 0;
|
this.progress = 0;
|
||||||
const flasher = new Nrf52DfuFlasher(serialPort);
|
|
||||||
await flasher.flash(file, (percentage) => {
|
// flash file
|
||||||
this.progress = percentage;
|
try {
|
||||||
if(this.progress === 100){
|
const flasher = new Nrf52DfuFlasher(serialPort);
|
||||||
this.isFlashing = false;
|
await flasher.flash(file, (percentage) => {
|
||||||
alert("Firmware has been flashed!");
|
this.progress = percentage;
|
||||||
}
|
if(this.progress === 100){
|
||||||
});
|
this.isFlashing = false;
|
||||||
|
alert("Firmware has been flashed!");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch(e) {
|
||||||
|
this.isFlashing = false;
|
||||||
|
alert("Firmware flashing failed: " + e);
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
async detect() {
|
async detect() {
|
||||||
|
|||||||
Reference in New Issue
Block a user