Skip to content

Commit

Permalink
Fix logging
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeuz committed Aug 3, 2023
1 parent bdd9b03 commit 1ee8c8a
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/dfu.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,8 @@ class Dfu {

this._log.trace('Wrote ' + chunkSize + ' bytes');
bytesSent += chunkSize;

this._log.info(bytesSent, expectedSize, 'program');
}
this._log.info(`Wrote ${bytesSent} bytes`);
this._log.info(`Wrote ${bytesSent} bytes total`);

if (options.leave) {
this._log.info('Manifesting new firmware');
Expand Down Expand Up @@ -609,9 +607,6 @@ class Dfu {

let bytesErased = 0;
const bytesToErase = endAddr - addr;
if (bytesToErase > 0) {
this._log.info(bytesErased, bytesToErase, 'erase');
}

while (addr < endAddr) {
if (segment.end <= addr) {
Expand All @@ -621,7 +616,6 @@ class Dfu {
// Skip over the non-erasable section
bytesErased = Math.min(bytesErased + segment.end - addr, bytesToErase);
addr = segment.end;
this._log.trace(bytesErased, bytesToErase, 'erase');
continue;
}
const sectorIndex = Math.floor((addr - segment.start) / segment.sectorSize);
Expand All @@ -630,7 +624,6 @@ class Dfu {
await this._dfuseCommand(DfuseCommand.DFUSE_COMMAND_ERASE, sectorAddr, 4);
addr = sectorAddr + segment.sectorSize;
bytesErased += segment.sectorSize;
this._log.info(bytesErased, bytesToErase, 'erase');
}
}

Expand Down

0 comments on commit 1ee8c8a

Please sign in to comment.