1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-23 08:15:22 +03:00

Added abort / error message when writing of downloaded blackbox log fails.

This commit is contained in:
mikeller 2018-04-24 23:54:40 +12:00
parent c5ae5d07a6
commit 02e0d75442
2 changed files with 12 additions and 1 deletions

View file

@ -5,6 +5,7 @@ var
TABS.onboard_logging = {
blockSize: 128,
writeError: false,
BLOCK_SIZE: 4096,
VCP_BLOCK_SIZE_3_0: 512,
@ -409,7 +410,11 @@ TABS.onboard_logging.initialize = function (callback) {
mark_saving_dialog_done(startTime, nextAddress, totalBytesCompressed);
}
} else {
mspHelper.dataflashRead(nextAddress, self.blockSize, onChunkRead);
if (!self.writeError) {
mspHelper.dataflashRead(nextAddress, self.blockSize, onChunkRead);
} else {
dismiss_saving_dialog();
}
}
};
@ -459,9 +464,12 @@ TABS.onboard_logging.initialize = function (callback) {
fileEntry.createWriter(function (fileWriter) {
fileWriter.onerror = function (e) {
GUI.log('<strong><span class="message-negative">' + i18n.getMessage('errorTitle') + ': ' + e.target.error.message + '</span class="message-negative></strong>');
console.error(e);
// stop logging if the procedure was/is still running
self.writeError = true;
};
onComplete(fileWriter);