Cleanup pins

This commit is contained in:
2026-06-16 19:04:50 +10:00
parent 1706186727
commit f0cd430eb9
3 changed files with 25 additions and 10 deletions
+11
View File
@@ -242,6 +242,8 @@
<option value="921600">921600</option>
</select>
</div>
<button class="danger" onclick="doReset()" title="Pulse the target reset line">Reset</button>
<button onclick="doButton()" title="Pulse the target button / wake line">Button</button>
<button onclick="clearTerminal()">Clear</button>
<button onclick="reconnect()">Reconnect</button>
<button id="logBtn" onclick="toggleLog()">Log: --</button>
@@ -591,6 +593,15 @@
return (bytes / 1024 / 1024).toFixed(1) + ' MB';
}
// ---- Target control lines (reset / button) ----
function pulseLine(path, label) {
fetch(path + '?ms=200').then(r => r.text())
.then(t => term.writeln(`\r\n\x1b[33m[${label}] ${t.trim()}\x1b[0m`))
.catch(() => term.writeln(`\r\n\x1b[31m[${label} failed]\x1b[0m`));
}
function doReset() { pulseLine('/api/reset', 'reset'); }
function doButton() { pulseLine('/api/button', 'button'); }
// ---- SD logging controls ----
let logOn = false;
function toggleLog() {