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

feat: make voyager indicator leds use binary for layer indication #375

Merged
merged 1 commit into from
Oct 17, 2023
Merged
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
51 changes: 5 additions & 46 deletions keyboards/voyager/voyager.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,55 +115,14 @@ layer_state_t layer_state_set_kb(layer_state_t state) {
#ifdef ORYX_ENABLE
if (rawhid_state.rgb_control) return state;
#endif
bool LED_1 = false;
bool LED_2 = false;
bool LED_3 = false;
# if !defined(CAPS_LOCK_STATUS)
bool LED_4 = false;
# endif

uint8_t layer = get_highest_layer(state);
switch (layer) {
case 1:
LED_1 = true;
break;
case 2:
LED_2 = true;
break;
case 3:
LED_3 = true;
break;
case 4:
# if !defined(CAPS_LOCK_STATUS)
LED_4 = true;
# endif
break;
case 5:
LED_1 = true;
LED_2 = true;
break;
case 6:
LED_1 = true;
LED_2 = true;
LED_3 = true;
break;
case 7:
LED_1 = true;
LED_2 = true;
LED_3 = true;
# if !defined(CAPS_LOCK_STATUS)
LED_4 = true;
# endif
break;
default:
break;
}

STATUS_LED_1(LED_1);
STATUS_LED_2(LED_2);
STATUS_LED_3(LED_3);
STATUS_LED_1(layer & (1<<0));
STATUS_LED_2(layer & (1<<1));
STATUS_LED_3(layer & (1<<2));

# if !defined(CAPS_LOCK_STATUS)
STATUS_LED_4(LED_4);
STATUS_LED_4(layer & (1<<3));
# endif
return state;
}
Expand Down
Loading