Skip to content

Commit

Permalink
Add support for LED intensity (OpenAnnePro#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdarkhan authored and bwisn committed Aug 29, 2021
1 parent 44ccba7 commit 1d7c968
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
5 changes: 4 additions & 1 deletion keyboards/annepro2/annepro2.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,12 @@ bool OVERRIDE process_record_kb(uint16_t keycode, keyrecord_t *record) {
break;

case KC_AP_LED_PREV_PROFILE:
annepro2LedPrevProfile();
annepro2LedPrevProfile();
break;

case KC_AP_LED_NEXT_INTENSITY:
annepro2LedNextIntensity();
return false;

default:
break;
Expand Down
2 changes: 1 addition & 1 deletion keyboards/annepro2/annepro2.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/

#pragma once
#include "annepro2.h"
#include "quantum.h"

#define OVERRIDE __attribute__ ((noinline))
Expand All @@ -41,5 +40,6 @@ enum AP2KeyCodes {
KC_AP_LED_OFF,
KC_AP_LED_NEXT_PROFILE,
KC_AP_LED_PREV_PROFILE,
KC_AP_LED_NEXT_INTENSITY,
AP2_SAFE_RANGE,
};
2 changes: 1 addition & 1 deletion keyboards/annepro2/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ enum anne_pro_layers {
*
*/
[_FN2_LAYER] = KEYMAP( /* Base */
KC_TRNS, KC_AP2_BT1, KC_AP2_BT2, KC_AP2_BT3, KC_AP2_BT4, KC_TRNS, KC_TRNS, KC_TRNS, KC_AP_LED_OFF, KC_AP_LED_ON, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_AP2_BT1, KC_AP2_BT2, KC_AP2_BT3, KC_AP2_BT4, KC_TRNS, KC_TRNS, KC_TRNS, KC_AP_LED_OFF, KC_AP_LED_ON, KC_AP_LED_NEXT_INTENSITY, KC_TRNS, KC_TRNS, KC_TRNS,
MO(_FN2_LAYER), KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_HOME, KC_END, KC_TRNS,
KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_PGDN, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_DEL, KC_TRNS,
Expand Down
5 changes: 5 additions & 0 deletions keyboards/annepro2/qmk_ap2_led.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ void annepro2LedNextProfile()
sdPut(&SD0, CMD_LED_NEXT_PROFILE);
}

void annepro2LedNextIntensity()
{
sdPut(&SD0, CMD_LED_NEXT_INTENSITY);
}

void annepro2LedPrevProfile()
{
sdPut(&SD0, CMD_LED_PREV_PROFILE);
Expand Down
2 changes: 2 additions & 0 deletions keyboards/annepro2/qmk_ap2_led.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#define CMD_LED_GET_NUM_PROFILES 0x9
#define CMD_LED_SET_MASK 0xA
#define CMD_LED_CLEAR_MASK 0xB
#define CMD_LED_NEXT_INTENSITY 0xC

void annepro2LedDisable(void);
void annepro2LedEnable(void);
Expand All @@ -23,3 +24,4 @@ void annepro2LedNextProfile(void);
void annepro2LedPrevProfile(void);
void annepro2LedSetMask(uint8_t key);
void annepro2LedClearMask(uint8_t key);
void annepro2LedNextIntensity(void);

0 comments on commit 1d7c968

Please sign in to comment.