Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions examples/typescript/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@

// Temporarily broken
// await esploader.flashId();
console.log("Settings done for :" + chip);

Check warning on line 110 in examples/typescript/src/index.ts

View workflow job for this annotation

GitHub Actions / ci

Unexpected console statement
lblBaudrate.style.display = "none";
lblConnTo.innerHTML = "Connected to device: " + chip;
lblConnTo.style.display = "block";
Expand All @@ -118,7 +118,7 @@
filesDiv.style.display = "initial";
consoleDiv.style.display = "none";
} catch (e) {
console.error(e);

Check warning on line 121 in examples/typescript/src/index.ts

View workflow job for this annotation

GitHub Actions / ci

Unexpected console statement
term.writeln(`Error: ${e.message}`);
}
};
Expand All @@ -142,7 +142,7 @@
try {
await esploader.eraseFlash();
} catch (e) {
console.error(e);

Check warning on line 145 in examples/typescript/src/index.ts

View workflow job for this annotation

GitHub Actions / ci

Unexpected console statement
term.writeln(`Error: ${e.message}`);
} finally {
eraseButton.disabled = false;
Expand Down Expand Up @@ -324,18 +324,14 @@
if (isConsoleClosed || !transport) return;

try {
const readLoop = transport.rawRead();

while (true && !isConsoleClosed) {
const { value, done } = await readLoop.next();
const value = await transport.rawRead();

if (done || !value) {
if (!value || value.length === 0) {
break;
}

if (value) {
term.write(value);
}
term.write(value);
}
} catch (error) {
if (!isConsoleClosed) {
Expand Down Expand Up @@ -445,7 +441,7 @@
await esploader.writeFlash(flashOptions);
await esploader.after();
} catch (e) {
console.error(e);

Check warning on line 444 in examples/typescript/src/index.ts

View workflow job for this annotation

GitHub Actions / ci

Unexpected console statement
term.writeln(`Error: ${e.message}`);
} finally {
// Hide progress bars and show erase buttons
Expand Down
Loading
Loading