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

Commit

Permalink
Merge pull request #338 from UltimateHackingKeyboard/fix_set_keyrgb_l…
Browse files Browse the repository at this point in the history
…ayer_sync

Fix set keyRgb state sync issues.
  • Loading branch information
mondalaci authored Nov 8, 2024
2 parents 5bb746d + 97d36e9 commit 28b254f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion device/src/state_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ static bool handlePropertyUpdateRightToLeft() {
UPDATE_AND_RETURN_IF_DIRTY(StateSyncPropertyId_ResetRightLeftLink);
UPDATE_AND_RETURN_IF_DIRTY(StateSyncPropertyId_Config);

if (KeyBacklightBrightness != 0 && Cfg.BacklightingMode != BacklightingMode_ConstantRGB) {
if (KeyBacklightBrightness != 0) {
// Update relevant data
UPDATE_AND_RETURN_IF_DIRTY(StateSyncPropertyId_PowerMode);
UPDATE_AND_RETURN_IF_DIRTY(StateSyncPropertyId_FunctionalColors);
Expand Down
6 changes: 6 additions & 0 deletions right/src/macros/set_command.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "macros/commands.h"
#include "module.h"
#include "secondary_role_driver.h"
#include "slot.h"
#include "timer.h"
#include "keymap.h"
#include "key_matrix.h"
Expand Down Expand Up @@ -493,6 +494,11 @@ static macro_variable_t keyRgb(parser_context_t* ctx, set_command_action_t actio
CurrentKeymap[layerId][slotIdx][inSlotIdx].colorOverridden = true;
CurrentKeymap[layerId][slotIdx][inSlotIdx].color = rgb;

#ifdef __ZEPHYR__
if (slotIdx != SlotId_RightKeyboardHalf) {
StateSync_UpdateLayer(layerId, true);
}
#endif
EventVector_Set(EventVector_LedMapUpdateNeeded);
return noneVar();
}
Expand Down

0 comments on commit 28b254f

Please sign in to comment.