Skip to content

Commit

Permalink
feat: make voyager indicator leds use binary for layer indication (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
drashna authored Oct 17, 2023
1 parent ed23f8a commit 47c470e
Showing 1 changed file with 5 additions and 46 deletions.
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

0 comments on commit 47c470e

Please sign in to comment.