@libs-scripts-mep/grav-fw-pvi 3.0.1 → 4.0.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.
package/README.md CHANGED
@@ -4,6 +4,8 @@ Biblioteca que auxilia na gravação de microcontroladores por linha de comando
4
4
 
5
5
  ## Instalando
6
6
 
7
+ > ### ⚠️ Compatibilidade PVI: [>= v4.8.0.0](https://git.inova.ind.br/Inova/PVI/releases/tag/4.8.0.0-beta0)
8
+
7
9
  Abra o terminal, e na pasta do script, execute:
8
10
 
9
11
  ```
package/grav-fw-pvi.js CHANGED
@@ -33,6 +33,7 @@ export default class GravaFW {
33
33
  if (dirFirm != null && dirOpt != null) { validationMsg = `Verify OPTION BYTE succeeds` }
34
34
  else if (dirFirm != null) { validationMsg = `Verifying PROGRAM MEMORY succeeds` }
35
35
  else if (dirOpt != null) { validationMsg = `Verify OPTION BYTE succeeds` }
36
+ else { validationMsg = "error" }
36
37
 
37
38
  let ObjWriteSTM8 = await defineWriteSTM8(dirFirm, dirOpt, objArguments)
38
39
 
@@ -88,7 +89,7 @@ export default class GravaFW {
88
89
  resolve({ success: false, msg: `Nenhum diretório de firmware ou option byte informado` })
89
90
  }
90
91
 
91
- FWLink.runInstructionS("EXEC", [`C:/Program Files (x86)/STMicroelectronics/st_toolset/stvp/STVP_CmdLine.exe`, ObjWriteSTM8.commandLineArguments, "true", "true"])
92
+ FWLink.runInstructionS("EXEC", [`${FWLink.runInstructionS("GETRESOURCESPATH", [])}\\stvp\\STVP_CmdLine.exe`, ObjWriteSTM8.commandLineArguments, "true", "true"])
92
93
 
93
94
  })
94
95
 
@@ -187,7 +188,7 @@ export default class GravaFW {
187
188
  FWLink.PVIEventObserver.remove(id)
188
189
  clearTimeout(timeOutGravacao)
189
190
 
190
- resolve({ success: null, msg: `Gravador não respondeu`, dirProject: dirProject })
191
+ resolve({ success: false, msg: `Gravador não respondeu`, dirProject: dirProject })
191
192
 
192
193
  } else if (param[0].includes(`Error: No project file specifed.`)) {
193
194
 
@@ -196,13 +197,20 @@ export default class GravaFW {
196
197
 
197
198
  resolve({ success: false, msg: `Projeto informado é inválido`, dirProject: dirProject })
198
199
 
200
+ } else if (param[0].includes(`A framing error occurred while receiving data`)) {
201
+
202
+ FWLink.PVIEventObserver.remove(id)
203
+ clearTimeout(timeOutGravacao)
204
+
205
+ resolve({ success: false, msg: `Falha ao receber dados do microcontrolador`, dirProject: dirProject })
206
+
199
207
  }
200
208
 
201
209
  }
202
210
 
203
211
  }, "sniffer.exec")
204
212
 
205
- FWLink.runInstructionS("EXEC", [`${FWLink.runInstructionS("GETPVIPATH", [])}/Resources/Renesas/RFPV3.Console.exe`, dirProject, "true", "true"])
213
+ FWLink.runInstructionS("EXEC", [`${FWLink.runInstructionS("GETRESOURCESPATH", [])}/Renesas/RFPV3.Console.exe`, dirProject, "true", "true"])
206
214
 
207
215
  let timeOutGravacao = setTimeout(() => {
208
216
 
@@ -357,4 +365,6 @@ export default class GravaFW {
357
365
  })
358
366
  }
359
367
 
368
+ static { window.GravaFW = GravaFW }
369
+
360
370
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libs-scripts-mep/grav-fw-pvi",
3
- "version": "3.0.1",
3
+ "version": "4.0.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": {