From 961b16f8d8ce36bb7703c9550a2c7ab64f3b23c4 Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Wed, 12 Jun 2024 13:40:30 +1000 Subject: [PATCH] Add warning if trying to upload to stm32 in serial mode --- index.html | 6 +++++- renderer.js | 27 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 5ae4d5e..4561615 100644 --- a/index.html +++ b/index.html @@ -80,14 +80,18 @@

Select Serial Port

Available Ports: - +

+

+
diff --git a/renderer.js b/renderer.js index c2795eb..35b968b 100644 --- a/renderer.js +++ b/renderer.js @@ -152,6 +152,33 @@ function refreshSerialPorts() }) } +//Checks whether the port currently selected is a known invalid one or not +function checkForValidPort() +{ + var validPort = true; + var errorText = "" + var option = document.getElementById('portsSelect').options[document.getElementById('portsSelect').selectedIndex]; + + if(option.getAttribute('board') == "STM32F407_serial") + { + validPort = false; + errorText = "Serial mode is not supported on STM32F407 boards. Please place the board into DFU mode instead."; + } + + if(validPort) + { + document.getElementById('port_warning').style.display = "none"; + document.getElementById('port_warningText').innerHTML = ""; + document.getElementById('btnInstall').disabled = false; + } + else + { + document.getElementById('port_warning').style.display = "block"; + document.getElementById('port_warningText').innerHTML = errorText; + document.getElementById('btnInstall').disabled = true; + } +} + function refreshDetails() { var selectElement = document.getElementById('versionsSelect');