@libs-scripts-mep/grav-fw-pvi 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/grav-fw-pvi.js +13 -6
  2. package/package.json +1 -1
package/grav-fw-pvi.js CHANGED
@@ -2,7 +2,7 @@ class GravaFW {
2
2
 
3
3
  /**
4
4
  * Realiza gravacao nos microcontroladores ST atraves do PVI, via STVP command line
5
- * @param {string} dirFirm formato esperado: "I:\\\Documentos\\\Softwares\\\STM8\\\STM8S003F3\\\INV-173\\\173v01\\\173v01_1.50_Com.stp"
5
+ * @param {string} dirFirm formato esperado: "I:\\\\Documentos\\\Softwares\\\STM8\\\STM8S003F3\\\INV-173\\\173v01\\\173v01_1.50_Com.stp"
6
6
  * @param {string} dirOpt formato esperado: "I:\\\Documentos\\\Softwares\\\STM8\\\STM8S003F3\\\INV-173\\\173v01\\\173v01_1.50_Com.stp"
7
7
  * @param {string} modelo_uC formato esperado: "STM8S003F3"
8
8
  */
@@ -226,13 +226,20 @@ class GravaFW {
226
226
  }
227
227
 
228
228
 
229
- static async ESP32(sessionStorageTag, appPath, isBatFile, betweenMsgTimeout) {
229
+ /**
230
+ * Realiza gravacao nos microcontroladores Nuvoton atraves do PVI, via JLink command line
231
+ * @param {string} sessionStorageTag nome que sera utilizado para armazenar a porta COM encontrada
232
+ * @param {string} appPath formato esperado: "I:\\Documentos\\Softwares\\ESP32\\INV-161\\31L\\INV-161_INV-161_HW2-31-FW-v1.bat" ou "I:\\Documentos\\Softwares\\ESP32\\INV-161\\31L\\INV-161_INV-161_HW2-31-FW-v1.bin"
233
+ * @param {boolean} isBatFile true = firmware esta em .bat / false = firmware esta em .bin
234
+ * @param {number} betweenMsgTimeout timeout maximo para inatividade na comunicação com o ESP32
235
+ */
236
+ static async ESP32(sessionStorageTag, AddressFilePath, isBatFile, betweenMsgTimeout) {
230
237
 
231
238
  return new Promise((resolve) => {
232
239
 
233
240
  console.time("WriteFirmware")
234
241
 
235
- if (!appPath) {
242
+ if (!AddressFilePath) {
236
243
  resolve({ sucess: false, msg: "Caminho de arquivo para gravação não especificado" }); return
237
244
  }
238
245
 
@@ -289,11 +296,11 @@ class GravaFW {
289
296
 
290
297
  sessionStorage.getItem(sessionStorageTag) != null ? port = `-p${sessionStorage.getItem(sessionStorageTag)}` : null
291
298
 
292
- const args = `${espToolPath} ${port} -b 480600 --before default_reset --after hard_reset --chip esp32 write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x0000 ${appPath}`
299
+ const args = `${espToolPath} ${port} -b 480600 --before default_reset --after hard_reset --chip esp32 write_flash --flash_mode dio --flash_size detect --flash_freq 40m ${AddressFilePath}`
293
300
 
294
301
  if (isBatFile) {
295
- console.log(`Executando batch: ${appPath} args: ${port}`)
296
- pvi.runInstructionS("EXEC", [appPath, port, "true", "true", "true"])
302
+ console.log(`Executando batch: ${AddressFilePath} args: ${port}`)
303
+ pvi.runInstructionS("EXEC", [AddressFilePath, port, "true", "true", "true"])
297
304
  } else {
298
305
  console.log(`Executando python: ${pythonPath} args: ${args}`)
299
306
  pvi.runInstructionS("EXEC", [pythonPath, args, "true", "true", "true"])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libs-scripts-mep/grav-fw-pvi",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Auxilia na gravação de microcontroladores por linha de comando através do PVI",
5
5
  "main": "grav-fw-pvi.js",
6
6
  "scripts": {