From b3cbf6ebaf9eef8ccf6e980ed08dc3e8807f438c Mon Sep 17 00:00:00 2001 From: Rushikesh Patange Date: Thu, 30 Nov 2023 15:41:14 +0530 Subject: [PATCH] fix: Resolve issue with passing correct variable type of baudrate and offset. --- js/index.js | 2 +- minimal-launchpad/minimal_ui_index.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/index.js b/js/index.js index f8b89f5..2f2c8a7 100644 --- a/js/index.js +++ b/js/index.js @@ -258,7 +258,7 @@ async function connectToDevice() { try { const loaderOptions = { transport, - baudrate: baudrates.value, + baudrate: parseInt(baudrates.value), terminal: espLoaderTerminal }; esploader = new ESPLoader(loaderOptions); diff --git a/minimal-launchpad/minimal_ui_index.js b/minimal-launchpad/minimal_ui_index.js index b191eed..bc3d625 100644 --- a/minimal-launchpad/minimal_ui_index.js +++ b/minimal-launchpad/minimal_ui_index.js @@ -81,7 +81,7 @@ async function downloadAndFlash() { let fileArr = [] for (let index = 0; index < imagePartsArray.length; index++) { let data = await utilities.getImageData(imagePartsArray[index]); - fileArr.push({ data: data, address: imagePartsOffsetArray[index] }); + fileArr.push({ data: data, address: parseInt(imagePartsOffsetArray[index]) }); } try { const flashOptions = { @@ -218,7 +218,7 @@ async function connectToDevice() { if (config.portConnectionOptions?.length) { loaderOptions = { transport: transport, - baudrate: config.portConnectionOptions[0]?.baudRate, + baudrate: parseInt(config.portConnectionOptions[0]?.baudRate), terminal: espLoaderTerminal, serialOptions, }; @@ -298,7 +298,7 @@ consoleStartButton.onclick = async () => { } } if (config.portConnectionOptions?.length) { - await transport.connect(config.portConnectionOptions[0]?.baudRate, serialOptions); + await transport.connect(parseInt(config.portConnectionOptions[0]?.baudRate), serialOptions); } else { await transport.connect(); }