Skip to content

Commit

Permalink
minor - rename functions in qdl
Browse files Browse the repository at this point in the history
  • Loading branch information
keeramis committed Jan 16, 2025
1 parent 646ee1c commit 9a69301
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/cmd/flash.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ module.exports = class FlashCommand extends CLICommandBase {
}
const outputLog = path.join(output ? output : process.cwd(), `tachyon_flash_${Date.now()}.log`);
try {
// put the output in a log file if not verbose
this.ui.write(`Logs are being written to: ${outputLog}${os.EOL}`);
const qdl = new QdlFlasher({
files: filesToProgram,
Expand All @@ -121,7 +120,7 @@ module.exports = class FlashCommand extends CLICommandBase {
fs.appendFileSync(outputLog, 'Download complete.');
} catch (error) {
this.ui.write('Download failed');
fs.appendFileSync(outputLog, 'Download failed.');
fs.appendFileSync(outputLog, 'Download failed with error: ' + error.message);
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/lib/qdl.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ class QdlFlasher {
if (line.includes('status=getProgramInfo')) {
this.handleProgramInfo(line);
} else if (line.includes('status=Start flashing module')) {
this.handleStartFlashingModule(line);
this.handleModuleStart(line);
} else if (line.includes('status=Flashing module')) {
this.handleFlashingModule(line);
this.handleModuleProgress(line);
}
}

Expand All @@ -120,7 +120,7 @@ class QdlFlasher {
}
}

handleStartFlashingModule(line) {
handleModuleStart(line) {
const moduleNameMatch = line.match(/module=(.*?),/);
const sectorsTotalMatch = line.match(/sectors_total=(\d+)/);
if (moduleNameMatch && sectorsTotalMatch) {
Expand All @@ -140,7 +140,7 @@ class QdlFlasher {
}
}

handleFlashingModule(line) {
handleModuleProgress(line) {
const sectorsFlashedMatch = line.match(/sectors_done=(\d+)/);
if (sectorsFlashedMatch) {
const sectorsFlashed = parseInt(sectorsFlashedMatch[1], 10);
Expand Down

0 comments on commit 9a69301

Please sign in to comment.