1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-19 22:35:17 +03:00

Clarify handling of compressed byte count when downloading uncompressed data flash.

This commit is contained in:
mikeller 2018-12-05 00:00:07 +13:00
parent 058e72811c
commit 63cfaef766

View file

@ -395,11 +395,10 @@ TABS.onboard_logging.initialize = function (callback) {
var totalTime = (new Date().getTime() - startTime) / 1000; var totalTime = (new Date().getTime() - startTime) / 1000;
console.log('Received ' + totalBytes + ' bytes in ' + totalTime.toFixed(2) + 's (' console.log('Received ' + totalBytes + ' bytes in ' + totalTime.toFixed(2) + 's ('
+ (totalBytes / totalTime / 1024).toFixed(2) + 'kB / s) with block size ' + self.blockSize + '.'); + (totalBytes / totalTime / 1024).toFixed(2) + 'kB / s) with block size ' + self.blockSize + '.');
if (totalBytesCompressed) { if (!isNaN(totalBytesCompressed)) {
console.log('Compressed into', totalBytesCompressed, 'bytes with mean compression factor of', totalBytes / totalBytesCompressed); console.log('Compressed into', totalBytesCompressed, 'bytes with mean compression factor of', totalBytes / totalBytesCompressed);
} }
$(".dataflash-saving").addClass("done"); $(".dataflash-saving").addClass("done");
} }
@ -440,7 +439,11 @@ TABS.onboard_logging.initialize = function (callback) {
// Did we receive any data? // Did we receive any data?
if (chunkDataView.byteLength > 0) { if (chunkDataView.byteLength > 0) {
nextAddress += chunkDataView.byteLength; nextAddress += chunkDataView.byteLength;
totalBytesCompressed += bytesCompressed; if (isNaN(bytesCompressed) || isNaN(totalBytesCompressed)) {
totalBytesCompressed = null;
} else {
totalBytesCompressed += bytesCompressed;
}
$(".dataflash-saving progress").attr("value", nextAddress / maxBytes * 100); $(".dataflash-saving progress").attr("value", nextAddress / maxBytes * 100);