diff --git a/public/mcm-81339-v0-28-0.bin b/public/mcm-81339-v0-28-0.bin deleted file mode 100644 index 4b2793a..0000000 --- a/public/mcm-81339-v0-28-0.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c652ec7f96135755ed6011d4399a6afaa6aa9d1ac45d959d0732895550fbf8a1 -size 1742544 diff --git a/public/mcm-81339-v0-29-0.bin b/public/mcm-81339-v0-29-0.bin new file mode 100644 index 0000000..10e93fd --- /dev/null +++ b/public/mcm-81339-v0-29-0.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be7e1d5c74df7f0fdeeffb44c14edc3247a367f7ec95806e6f1151efb9834320 +size 1780768 diff --git a/public/mcm-81349-v0-28-0.bin b/public/mcm-81349-v0-28-0.bin deleted file mode 100644 index ca76ba0..0000000 --- a/public/mcm-81349-v0-28-0.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6bb45a666c91ff3b02b0ae257978a3714ce08eb41d23dbaf084afaa5897b2d3c -size 1742608 diff --git a/public/mcm-81349-v0-29-0.bin b/public/mcm-81349-v0-29-0.bin new file mode 100644 index 0000000..abed4ef --- /dev/null +++ b/public/mcm-81349-v0-29-0.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ba65115e4ad45f42b66d19b5d318e0346e7791837b38f696354bb459025c2de +size 1780832 diff --git a/src/js/usbMcmLin.js b/src/js/usbMcmLin.js index b487a54..0477b73 100644 --- a/src/js/usbMcmLin.js +++ b/src/js/usbMcmLin.js @@ -1,9 +1,11 @@ import { McmGeneric } from './usbMcmGeneric'; import { convertUint16ToUint8Array, convertUint32ToUint8Array, MasterMode, mcmMlxMessageId, mcmVendorRequest } from './usbTransport'; -const MEMORY_FLASH = 1; -const MEMORY_NVRAM = 0; - +const BTL_MEMORY = { + nvram: 0, + flash: 1, + flash_cs: 2, +}; const OPP_PROGRAM = 0; const OPP_VERIFY = 1; @@ -37,6 +39,11 @@ export class McmLin extends McmGeneric { await this.disableLinMode(); } + const memType = BTL_MEMORY[memory.toLowerCase()]; + if (memType === undefined) { + throw new Error(`Unknown memory type: "${memory}". Valid types: ${Object.keys(BTL_MEMORY).join(', ')}`); + } + // transfer hex file await this.transport.doHexfileTransfer(hexfile); @@ -44,7 +51,7 @@ export class McmLin extends McmGeneric { payload.set(convertUint32ToUint8Array(bitRate), 0); // baudrate to be used during bootloader operations payload[4] = manualPower ? 1 : 0; // 1: manual power cycling payload[5] = broadcast ? 1 : 0; // 1: bootloading shall be done in broadcast mode - payload[6] = memory.toLowerCase() === 'flash' ? MEMORY_FLASH : MEMORY_NVRAM; // memory type to perform action on (0: NVRAM; 1: flash) + payload[6] = memType; // memory type to perform action on (0: NVRAM; 1: flash; 2=flash_cs) payload[7] = operation.toLowerCase() === 'program' ? OPP_PROGRAM : OPP_VERIFY; // action type to perform (0: program; 1: verify) try { diff --git a/src/views/pwm/PwmController.vue b/src/views/pwm/PwmController.vue index 17e3648..75c0d13 100644 --- a/src/views/pwm/PwmController.vue +++ b/src/views/pwm/PwmController.vue @@ -11,6 +11,8 @@ const mcm = new McmPwm(transport); const errorMsg = ref(''); const isErrorMsg = ref(false); +let errorCount = 0; +const ERROR_DISPLAY_POLLS = 10; /* 10 × 250 ms = 2.5 s */ const pwmFrequency = ref(1000); const pwmDutyCycle = ref(0); @@ -34,6 +36,7 @@ onMounted(async () => { } catch (error) { isErrorMsg.value = true; errorMsg.value = error.message; + errorCount = ERROR_DISPLAY_POLLS; } }); @@ -51,6 +54,7 @@ async function updateDutyCycle () { } catch (error) { isErrorMsg.value = true; errorMsg.value = error.message; + errorCount = ERROR_DISPLAY_POLLS; } } @@ -60,6 +64,7 @@ async function updateFrequency () { } catch (error) { isErrorMsg.value = true; errorMsg.value = error.message; + errorCount = ERROR_DISPLAY_POLLS; } } @@ -82,6 +87,14 @@ async function updateStatus () { } catch { /* silent polling error (optional) */ } + + if (errorCount > 0) { + errorCount -= 1; + if (errorCount === 0) { + isErrorMsg.value = false; + errorMsg.value = ''; + } + } } @@ -163,12 +176,6 @@ async function updateStatus () { Live Status - -
PWM Frequency @@ -191,6 +198,12 @@ async function updateStatus () { {{ pwmStatFgFrequency ?? '--' }} Hz
+ + diff --git a/src/views/system/SystemUpgrade.vue b/src/views/system/SystemUpgrade.vue index 5fad69f..488e0f9 100644 --- a/src/views/system/SystemUpgrade.vue +++ b/src/views/system/SystemUpgrade.vue @@ -23,8 +23,8 @@ const firmwareBaseNames = { 'Melexis Compact Master LIN': 'mcm-lin', }; const firmwareLatestRev = { - 'mcm-81339': 'v0.28.0', - 'mcm-81349': 'v0.28.0', + 'mcm-81339': 'v0.29.0', + 'mcm-81349': 'v0.29.0', 'mcm-lin': 'v0.4.0', }; let firmwareBaseName = '';