Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Commit

Permalink
Remove action count limitation for UHK60
Browse files Browse the repository at this point in the history
  • Loading branch information
kareltucek committed Oct 10, 2024
1 parent fd3e67f commit 041b0c6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions right/src/config_parser/parse_keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,18 +169,16 @@ static parser_error_t parseKeyActions(uint8_t targetLayer, config_buffer_t *buff
parser_error_t errorCode;
uint16_t actionCount = ReadCompactLength(buffer);

if (actionCount > MAX_KEY_COUNT_PER_MODULE) {
ConfigParser_Error(buffer, "Invalid action count: %d", actionCount);
return ParserError_InvalidActionCount;
}
if (moduleId == ModuleId_LeftKeyboardHalf || moduleId == ModuleId_KeyClusterLeft) {
parseMode = parseMode;
} else {
parseMode = IsModuleAttached(moduleId) ? parseMode : ParseMode_DryRun;
}
slot_t slotId = ModuleIdToSlotId(moduleId);
for (uint8_t actionIdx = 0; actionIdx < actionCount; actionIdx++) {
errorCode = parseKeyAction(&CurrentKeymap[targetLayer][slotId][actionIdx], buffer, parseMode);
key_action_t dummyKeyAction;
key_action_t *keyAction = actionIdx < MAX_KEY_COUNT_PER_MODULE ? &CurrentKeymap[targetLayer][slotId][actionIdx] : &dummyKeyAction;
errorCode = parseKeyAction(keyAction, buffer, parseMode);
if (errorCode != ParserError_Success) {
return errorCode;
}
Expand Down

0 comments on commit 041b0c6

Please sign in to comment.