adding noReset() button

The ESP32 boards with co-processor (PyPortal, MatrixPortal, Metro Airlift) running passthru code will not connect over serial if reset. This adds a button to avoid resets, but the default is to reset.
pull/297/head
Mikey Sklar 4 months ago
parent ffa6646aec
commit bdaeb7f05d

File diff suppressed because it is too large Load Diff

@ -62,6 +62,21 @@
<div class="subheader"> <div class="subheader">
<div class="title left">Adafruit ESPTool</div> <div class="title left">Adafruit ESPTool</div>
<div class="right"> <div class="right">
<!-- New No Reset Toggle -->
<label for="noReset"> Connect without Reset </label>
<div class="onoffswitch" style="margin-right: 30px;">
<input
type="checkbox"
name="noReset"
class="onoffswitch-checkbox"
id="noReset"
checked="false"
/>
<label class="onoffswitch-label" for="noReset">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
<label for="darkmode"> Dark Mode </label> <label for="darkmode"> Dark Mode </label>
<div class="onoffswitch"> <div class="onoffswitch">
<input <input
@ -76,6 +91,7 @@
</label> </label>
</div> </div>
</div> </div>
</div>
</div> </div>
<div id="app"> <div id="app">
<div id="commands"> <div id="commands">
@ -199,4 +215,4 @@
</div> </div>
</footer> </footer>
</body> </body>
</html> </html>

@ -21,6 +21,7 @@ const firmware = document.querySelectorAll(".upload .firmware input");
const progress = document.querySelectorAll(".upload .progress-bar"); const progress = document.querySelectorAll(".upload .progress-bar");
const offsets = document.querySelectorAll(".upload .offset"); const offsets = document.querySelectorAll(".upload .offset");
const appDiv = document.getElementById("app"); const appDiv = document.getElementById("app");
const noReset = document.getElementById("noReset");
document.addEventListener("DOMContentLoaded", () => { document.addEventListener("DOMContentLoaded", () => {
butConnect.addEventListener("click", () => { butConnect.addEventListener("click", () => {
@ -45,6 +46,7 @@ document.addEventListener("DOMContentLoaded", () => {
autoscroll.addEventListener("click", clickAutoscroll); autoscroll.addEventListener("click", clickAutoscroll);
baudRate.addEventListener("change", changeBaudRate); baudRate.addEventListener("change", changeBaudRate);
darkMode.addEventListener("click", clickDarkMode); darkMode.addEventListener("click", clickDarkMode);
noReset.addEventListener("click", clickNoReset);
window.addEventListener("error", function (event) { window.addEventListener("error", function (event) {
console.log("Got an uncaught error: ", event.error); console.log("Got an uncaught error: ", event.error);
}); });
@ -241,6 +243,22 @@ async function clickDarkMode() {
saveSetting("darkmode", darkMode.checked); saveSetting("darkmode", darkMode.checked);
} }
/**
* @name clickNoReset
* Change handler for ESP32 co-processor boards
*/
async function clickNoReset() {
saveSetting("noReset", noReset.checked);
if (espStub) {
try {
// Assuming espStub has a setNoReset method, similar to setBaudrate
await espStub.setNoReset(noReset.checked);
} catch (error) {
console.error("Failed to set noReset:", error);
}
}
}
/** /**
* @name clickErase * @name clickErase
* Click handler for the erase button. * Click handler for the erase button.
@ -421,6 +439,7 @@ function loadAllSettings() {
autoscroll.checked = loadSetting("autoscroll", true); autoscroll.checked = loadSetting("autoscroll", true);
baudRate.value = loadSetting("baudrate", 115200); baudRate.value = loadSetting("baudrate", 115200);
darkMode.checked = loadSetting("darkmode", false); darkMode.checked = loadSetting("darkmode", false);
noReset.checked = loadSetting("noReset", false);
} }
function loadSetting(setting, defaultValue) { function loadSetting(setting, defaultValue) {

Loading…
Cancel
Save