Skip to content

Commit

Permalink
Add alert for unsupported chips
Browse files Browse the repository at this point in the history
  • Loading branch information
neil-pozetroninc committed Aug 13, 2023
1 parent 1949ea9 commit 811fa95
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion examples/typescript/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,17 @@ function validate_program_inputs() {
return "success";
}

function validate_chip_support() {
// Check if chip contains "C3" or "S3"
if (chip.includes('C3') || chip.includes('S3')){

Check failure on line 261 in examples/typescript/src/index.ts

View workflow job for this annotation

GitHub Actions / ci

Replace `'C3')·||·chip.includes('S3'))` with `"C3")·||·chip.includes("S3"))·`
alert("Unsupported Chip. Flashing may or may not work.")

Check failure on line 262 in examples/typescript/src/index.ts

View workflow job for this annotation

GitHub Actions / ci

Insert `;`
};

Check failure on line 263 in examples/typescript/src/index.ts

View workflow job for this annotation

GitHub Actions / ci

Delete `;`
}

programButton.onclick = async () => {
const alertMsg = document.getElementById("alertmsg");
const err = validate_program_inputs();
const err = validate_program_inputs()

Check failure on line 268 in examples/typescript/src/index.ts

View workflow job for this annotation

GitHub Actions / ci

Replace `·` with `;`
validate_chip_support();

if (err != "success") {
alertMsg.innerHTML = "<strong>" + err + "</strong>";
Expand Down

0 comments on commit 811fa95

Please sign in to comment.