From 773242503ca7e12f7a77a588789640d0dbde8c04 Mon Sep 17 00:00:00 2001 From: Florian Date: Fri, 18 Mar 2022 18:24:43 +0100 Subject: annepro2: Add more LED functionalities to default-layer-indicators (#16676) --- keyboards/annepro2/annepro2.c | 9 +++++++++ keyboards/annepro2/annepro2.h | 1 + keyboards/annepro2/keymaps/default-layer-indicators/keymap.c | 9 +++++++-- 3 files changed, 17 insertions(+), 2 deletions(-) (limited to 'keyboards') diff --git a/keyboards/annepro2/annepro2.c b/keyboards/annepro2/annepro2.c index 8767265315..0f49f93104 100644 --- a/keyboards/annepro2/annepro2.c +++ b/keyboards/annepro2/annepro2.c @@ -192,6 +192,15 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { ap2_led_reset_foreground_color(); break; + case KC_AP_LED_TOG: + if (ap2_led_status.matrix_enabled) { + ap2_led_disable(); + } else { + ap2_led_enable(); + ap2_led_reset_foreground_color(); + } + break; + case KC_AP_LED_NEXT_PROFILE: ap2_led_next_profile(); ap2_led_reset_foreground_color(); diff --git a/keyboards/annepro2/annepro2.h b/keyboards/annepro2/annepro2.h index 1b5933f577..143904b6ad 100644 --- a/keyboards/annepro2/annepro2.h +++ b/keyboards/annepro2/annepro2.h @@ -53,6 +53,7 @@ enum AP2KeyCodes { KC_AP2_USB, KC_AP_LED_ON, KC_AP_LED_OFF, + KC_AP_LED_TOG, KC_AP_LED_NEXT_PROFILE, KC_AP_LED_PREV_PROFILE, KC_AP_LED_NEXT_INTENSITY, diff --git a/keyboards/annepro2/keymaps/default-layer-indicators/keymap.c b/keyboards/annepro2/keymaps/default-layer-indicators/keymap.c index 405769466a..1fd97c584e 100644 --- a/keyboards/annepro2/keymaps/default-layer-indicators/keymap.c +++ b/keyboards/annepro2/keymaps/default-layer-indicators/keymap.c @@ -83,7 +83,7 @@ enum anne_pro_layers { /* * Layer FN2 * ,-----------------------------------------------------------------------------------------. - * | ~ | BT1 | BT2 | BT3 | BT4 | F5 | F6 | F7 |LEDOF|LEDON| F10 | F11 | F12 | Bksp | + * | ~ | BT1 | BT2 | BT3 | BT4 | F5 | F6 | F7 | F8 |LEDTG|LEDI+|LEDPV|LEDNX| Bksp | * |-----------------------------------------------------------------------------------------+ * | Tab | q | UP | e | r | t | y | u | i | o | PS | HOME | END | \ | * |-----------------------------------------------------------------------------------------+ @@ -96,7 +96,7 @@ enum anne_pro_layers { * */ [FN2] = LAYOUT_60_ansi( /* FN2 */ - _______, KC_AP2_BT1, KC_AP2_BT2, KC_AP2_BT3, KC_AP2_BT4, _______, _______, _______, KC_AP_LED_OFF, KC_AP_LED_ON, _______, _______, _______, _______, + _______, KC_AP2_BT1, KC_AP2_BT2, KC_AP2_BT3, KC_AP2_BT4, _______, _______, _______, _______, KC_AP_LED_TOG, KC_AP_LED_NEXT_INTENSITY, KC_AP_LED_PREV_PROFILE, KC_AP_LED_NEXT_PROFILE, _______, MO(FN2), _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_HOME, KC_END, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, KC_DEL, _______, @@ -105,6 +105,11 @@ enum anne_pro_layers { }; // clang-format on +void keyboard_post_init_user(void) { + ap2_led_enable(); + ap2_led_set_profile(7); +} + layer_state_t layer_state_set_user(layer_state_t state) { switch (get_highest_layer(state)) { case FN1: -- cgit v1.2.3