diff --git a/ui/arduino/main.css b/ui/arduino/main.css index 2c94b7d..cc0e95c 100644 --- a/ui/arduino/main.css +++ b/ui/arduino/main.css @@ -131,7 +131,7 @@ button.small .icon { #tabs { display: flex; - padding: 10px 10px 0px 40px; + padding: 10px 10px 0px 60px; align-items: center; gap: 10px; align-self: stretch; @@ -231,7 +231,7 @@ button.small .icon { #code-editor .cm-gutters { background-color: #ECF1F1; border-right: none; - width: 40px; + width: 60px; font-size: 14px; } diff --git a/ui/arduino/store.js b/ui/arduino/store.js index 2c93a7e..c748905 100644 --- a/ui/arduino/store.js +++ b/ui/arduino/store.js @@ -122,14 +122,28 @@ async function store(state, emitter) { state.isConnecting = true emitter.emit('render') - let timeout_id = setTimeout(() => emitter.emit('connection-timeout'), 5000) - await serial.connect(path) - clearTimeout(timeout_id) - + // The following Timeout operation will be cleared after a succesful getPrompt() + // If a board has crashed and/or cannot return a REPL prompt, the connection will fail + // and the user will be prompted to reset the device and try again. + let timeout_id = setTimeout(() => { + let response = win.openDialog({ + type: 'question', + buttons: ['OK'], + cancelId: 0, + message: "Could not connect to the board. Reset it and try again." + }) + console.log('Reset request acknowledged', response) + emitter.emit('connection-timeout') + }, 3500) + try { + await serial.connect(path) + } catch(e) { + console.error(e) + } // Stop whatever is going on // Recover from getting stuck in raw repl await serial.getPrompt() - + clearTimeout(timeout_id) // Connected and ready state.isConnecting = false state.isConnected = true
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: