From a21c79245a09fdd71b55240e893eabbb65abb47b Mon Sep 17 00:00:00 2001 From: Murilo Polese Date: Tue, 16 Apr 2024 10:08:56 +0200 Subject: [PATCH 1/3] Remove unused dependencies --- ui/arduino/index.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/ui/arduino/index.html b/ui/arduino/index.html index 5b82565..25f1967 100644 --- a/ui/arduino/index.html +++ b/ui/arduino/index.html @@ -19,8 +19,6 @@ - - From f542eb7b4db1dfd9f8c90283dc25f68ecfee777d Mon Sep 17 00:00:00 2001 From: Murilo Polese Date: Tue, 16 Apr 2024 10:09:58 +0200 Subject: [PATCH 2/3] Getting prompt before performing serial operations (saving) --- ui/arduino/store.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/arduino/store.js b/ui/arduino/store.js index 095acc5..3c32037 100644 --- a/ui/arduino/store.js +++ b/ui/arduino/store.js @@ -272,6 +272,7 @@ async function store(state, emitter) { // Check if the current full path exists let fullPathExists = false if (openFile.source == 'board') { + await serial.get_prompt() fullPathExists = await serial.fileExists( serial.getFullPath( state.boardNavigationRoot, @@ -294,6 +295,7 @@ async function store(state, emitter) { if (openFile.source == 'board') { openFile.parentFolder = state.boardNavigationPath // Check for overwrite + await serial.get_prompt() willOverwrite = await serial.fileExists( serial.getFullPath( state.boardNavigationRoot, From 4c5fe4f7042ed85e510864a8a2873afbbf2c3762 Mon Sep 17 00:00:00 2001 From: Murilo Polese Date: Tue, 16 Apr 2024 10:23:21 +0200 Subject: [PATCH 3/3] Fix camel case --- preload.js | 4 ++-- ui/arduino/store.js | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/preload.js b/preload.js index 8ad4791..96a7339 100644 --- a/preload.js +++ b/preload.js @@ -24,10 +24,10 @@ const Serial = { execFile: async (path) => { return board.execfile(path) }, - get_prompt: async () => { + getPrompt: async () => { return board.get_prompt() }, - keyboard_interrupt: async () => { + keyboardInterrupt: async () => { await board.stop() return Promise.resolve() }, diff --git a/ui/arduino/store.js b/ui/arduino/store.js index 3c32037..80656a5 100644 --- a/ui/arduino/store.js +++ b/ui/arduino/store.js @@ -115,7 +115,7 @@ async function store(state, emitter) { // Stop whatever is going on // Recover from getting stuck in raw repl - await serial.get_prompt() + await serial.getPrompt() // Make sure there is a lib folder log('creating lib folder') @@ -174,7 +174,7 @@ async function store(state, emitter) { emitter.emit('open-panel') emitter.emit('render') try { - await serial.get_prompt() + await serial.getPrompt() await serial.run(code) } catch(e) { log('error', e) @@ -187,7 +187,7 @@ async function store(state, emitter) { } emitter.emit('open-panel') emitter.emit('render') - await serial.get_prompt() + await serial.getPrompt() }) emitter.on('reset', async () => { log('reset') @@ -272,7 +272,7 @@ async function store(state, emitter) { // Check if the current full path exists let fullPathExists = false if (openFile.source == 'board') { - await serial.get_prompt() + await serial.getPrompt() fullPathExists = await serial.fileExists( serial.getFullPath( state.boardNavigationRoot, @@ -295,7 +295,7 @@ async function store(state, emitter) { if (openFile.source == 'board') { openFile.parentFolder = state.boardNavigationPath // Check for overwrite - await serial.get_prompt() + await serial.getPrompt() willOverwrite = await serial.fileExists( serial.getFullPath( state.boardNavigationRoot, @@ -330,7 +330,7 @@ async function store(state, emitter) { const contents = openFile.editor.editor.state.doc.toString() try { if (openFile.source == 'board') { - await serial.get_prompt() + await serial.getPrompt() await serial.saveFileContent( serial.getFullPath( state.boardNavigationRoot, @@ -920,7 +920,7 @@ async function store(state, emitter) { const contents = openFile.editor.editor.state.doc.toString() try { if (openFile.source == 'board') { - await serial.get_prompt() + await serial.getPrompt() await serial.saveFileContent( serial.getFullPath( state.boardNavigationRoot, @@ -983,7 +983,7 @@ async function store(state, emitter) { const contents = openFile.editor.editor.state.doc.toString() try { if (openFile.source == 'board') { - await serial.get_prompt() + await serial.getPrompt() await serial.saveFileContent( serial.getFullPath( state.boardNavigationRoot, @@ -1384,7 +1384,7 @@ async function getAvailablePorts() { } async function getBoardFiles(path) { - await serial.get_prompt() + await serial.getPrompt() let files = await serial.ilistFiles(path) files = files.map(f => ({ fileName: f[0], @@ -1403,6 +1403,7 @@ function checkDiskFile({ root, parentFolder, fileName }) { async function checkBoardFile({ root, parentFolder, fileName }) { if (root == null || parentFolder == null || fileName == null) return false + await serial.getPrompt() return serial.fileExists( serial.getFullPath(root, parentFolder, fileName) ) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

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:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy