diff --git a/right/src/main.c b/right/src/main.c index 92ef55b0..d8e6aed6 100644 --- a/right/src/main.c +++ b/right/src/main.c @@ -94,7 +94,7 @@ void CopyRightKeystateMatrix(void) uint8_t targetKeyId; // TODO: optimize this? This translation is quite costly :-/ - if (DataModelVersion.major >= 8) { + if (VERSION_AT_LEAST(DataModelVersion, 8, 2, 0)) { targetKeyId = KeyLayout_Uhk60_to_Universal[SlotId_RightKeyboardHalf][keyId]; } else { targetKeyId = keyId; diff --git a/right/src/slave_drivers/uhk_module_driver.c b/right/src/slave_drivers/uhk_module_driver.c index 311fdb83..b88c58f5 100644 --- a/right/src/slave_drivers/uhk_module_driver.c +++ b/right/src/slave_drivers/uhk_module_driver.c @@ -1,4 +1,5 @@ #include +#include "config_parser/parse_config.h" #include "i2c_addresses.h" #include "i2c.h" @@ -133,14 +134,18 @@ void UhkModuleSlaveDriver_ProcessKeystates(uint8_t uhkModuleDriverId, uhk_module uint8_t targetKeyId; // TODO: optimize this? This translation is quite costly :-/ - if (DataModelVersion.major >= 8 && uhkModuleDriverId == UhkModuleDriverId_LeftKeyboardHalf) { + if ( + DEVICE_IS_UHK60 + && VERSION_AT_LEAST(DataModelVersion, 8, 2, 0) + && uhkModuleDriverId == UhkModuleDriverId_LeftKeyboardHalf + ) { targetKeyId = KeyLayout_Uhk60_to_Universal[SlotId_LeftKeyboardHalf][keyId]; } else { targetKeyId = keyId; } - if (KeyStates[slotId][targetKeyId].hardwareSwitchState != keyStatesBuffer[targetKeyId]) { - KeyStates[slotId][targetKeyId].hardwareSwitchState = keyStatesBuffer[targetKeyId]; + if (KeyStates[slotId][targetKeyId].hardwareSwitchState != keyStatesBuffer[keyId]) { + KeyStates[slotId][targetKeyId].hardwareSwitchState = keyStatesBuffer[keyId]; stateChanged = true; } } diff --git a/scripts/package.json b/scripts/package.json index 986fda36..a645ed08 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -22,7 +22,7 @@ "firmwareVersion": "11.2.0", "deviceProtocolVersion": "4.10.0", "moduleProtocolVersion": "4.3.0", - "userConfigVersion": "8.1.0", + "userConfigVersion": "8.2.0", "hardwareConfigVersion": "1.0.0", "smartMacrosVersion": "2.5.0", "devices": [