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

Merge pull request #1012 from mikeller/fix_blackbox_write_error

Added abort / error message when writing of downloaded blackbox log fails.
This commit is contained in:
Michael Keller 2018-05-04 21:48:13 +12:00 committed by GitHub
commit cbd4c30857
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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('error', { errorMessage: 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);