[Solved] Firmware v10.4.0 - Macro problems

Hi,

A few minutes ago I flashed the latest 10.4.0 firmware.
I now get this error in a dark yellow message box at the bottom of the UHK software (e.g. when I remap a key and try to save the new configuration to the keyboard):

Error at LED brightness toggle 1/1/1: Unrecognized command: ifNotRegEq
> 1 | ifNotRegEq 30 1 goTo switchHigh
>   | ^
Error at LED brightness toggle 1/2/1: Unrecognized command: ifRegEq
> 2 | ifRegEq 30 1 goTo switchLow
>   | ^
Error at LED brightness toggle 1/6/7: Unrecognized command: setReg
> 6 | final setReg 30 1
>   |       ^
Error at LED brightness toggle 1/9/1: Unrecognized command: setReg
> 9 | setReg 30 0
>   | ^
Error at Record typing 1/1/21: Could not parse #key
> 1 | ifShift recordMacro #key
>   |                     ^
Error at Record typing 1/2/22: Could not parse #key
> 2 | ifNotShift playMacro #key
>   |                      ^

These two macros are:
LED brightness toggle:

ifNotRegEq 30 1 goTo switchHigh
ifRegEq 30 1 goTo switchLow

switchHigh:
set leds.brightness 1
final setReg 30 1
switchLow:
set leds.brightness 0.1
setReg 30 0

Record typing:

ifShift recordMacro #key
ifNotShift playMacro #key

The reference guide (https://github.com/UltimateHackingKeyboard/firmware/blob/v10.4.0/doc-dev/reference-manual.md) still lists e.g. ifNotRegEq
so why should trigger its usage an “Unrecognized command” warning / error?

The reference guide lists it in a removed command section.

Registers were removed in favor of newly implemented named variables. If you flash 10.2 firmware, its warnings will guide you through upgrading your macros.

1 Like

Thanks @kareltucek !

The updated macros look like this:
LED brightness toggle:

if ($leds.brightness == 1) {
    set leds.brightness 0.1
}
else {
    set leds.brightness 1
}

Record typing:

ifShift recordMacro $thisKeyId
ifNotShift playMacro $thisKeyId
1 Like