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:
parent
058e72811c
commit
63cfaef766
1 changed files with 6 additions and 3 deletions
|
@ -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);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue