Skip to content

Commit

Permalink
Improve logic for switching off and on of LEDs (OpenAnnePro#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdarkhan authored and bwisn committed Aug 29, 2021
1 parent 1d7c968 commit 330f32a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions keyboards/annepro2/annepro2.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ static uint8_t ledMcuWakeup[11] = {
0x7b, 0x10, 0x43, 0x10, 0x03, 0x00, 0x00, 0x7d, 0x02, 0x01, 0x02
};

static bool ledEnabled = false;

ble_capslock_t BLECapsLock = {._dummy = {0}, .caps_lock = false};

uint16_t annepro2LedMatrix[MATRIX_ROWS * MATRIX_COLS] = {
Expand Down Expand Up @@ -113,13 +115,17 @@ bool OVERRIDE process_record_kb(uint16_t keycode, keyrecord_t *record) {
return false;

case KC_AP_LED_OFF:
annepro2LedPrevProfile();
annepro2LedDisable();
ledEnabled = false;
break;

case KC_AP_LED_ON:
annepro2LedNextProfile();
annepro2LedEnable();
if (ledEnabled) {
annepro2LedNextProfile();
} else {
ledEnabled = true;
annepro2LedEnable();
}
break;

case KC_AP_LED_NEXT_PROFILE:
Expand Down

0 comments on commit 330f32a

Please sign in to comment.