Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix id67 RGB Matrix #16916

Merged
merged 2 commits into from
Apr 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion keyboards/idobao/id67/id67.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ led_config_t g_led_config = { {
__attribute__ ((weak))
void rgb_matrix_indicators_user(void) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this entire function should be removed

  1. caps lock state should not be coded into the core file. also #FFFFFF is really bright ! This value should be based on current brightness values
  2. value would have been 36. idx-2-phys & led-idx are reversed, but not the kmtrx-2-led-idx in g_led_config

if (host_keyboard_led_state().caps_lock) {
rgb_matrix_set_color(ID67_CAPS_LOCK_KEY_INDEX, 0xFF, 0xFF, 0xFF);
rgb_matrix_set_color(23, 0xFF, 0xFF, 0xFF);
}
}
8 changes: 4 additions & 4 deletions keyboards/idobao/id67/keymaps/vinorodrigues/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,15 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {

if (host_keyboard_led_state().caps_lock) {
if (isRGBOff) {
rgb_matrix_set_color(ID67_CAPS_LOCK_KEY_INDEX, v, v, v); // white
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 85 of this file should contain:

#define CAPS_LOCK_KEY_INDEX 36  // position of Caps Lock key

this value is specific to this keymap ... not sure how it ended up in root file id67.c

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sorry. I suppose I was thrown off by this comment
https://github.com/qmk/qmk_firmware/blob/master/keyboards/idobao/id67/id67.c#L22

Copy link
Contributor

@vinorodrigues vinorodrigues Apr 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

np. it's confusing as heck. i had to retest my assumptions twice to confirm what i'd written a few months back.

and hey! thanks for trying to fix it - i was slow to see that it was posted and didn't check anyway. by the time i realised you'd already pr'ed it. no foul and the community thanks you for your contributions!

rgb_matrix_set_color(23, v, v, v); // white
} else {
// Caps Lock key/LED
if (timer_elapsed(recording_timer) > 500) {
isCapsBlink = !isCapsBlink;
recording_timer = timer_read();
}
if (isCapsBlink) {
rgb_matrix_set_color(ID67_CAPS_LOCK_KEY_INDEX, v, v, v); // white
rgb_matrix_set_color(23, v, v, v); // white
}

// Alpha keys/LEDs
Expand All @@ -144,15 +144,15 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
uint8_t g = 0;
uint8_t b = 0;

if ((g_led_config.flags[ID67_CAPS_LOCK_KEY_INDEX] & LED_FLAG_LAYER_IND) != 0) {
if ((g_led_config.flags[23] & LED_FLAG_LAYER_IND) != 0) {
switch (current_layer) {
case LAYER_1: b = v; break; // blue
case LAYER_2: g = v; break; // green
case LAYER_3: r = v; break; // red
}
}

rgb_matrix_set_color(ID67_CAPS_LOCK_KEY_INDEX, r, g, b); // off
rgb_matrix_set_color(23, r, g, b); // off
}

// Layer indicator stuff
Expand Down