From 5a180e65d9b43d793e6c72794ebd0dd56a826ef1 Mon Sep 17 00:00:00 2001 From: Alexander Fougner Date: Mon, 3 Dec 2018 19:09:30 +0100 Subject: [PATCH] xd87: add capslock led support --- keyboards/xd87/xd87.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/keyboards/xd87/xd87.c b/keyboards/xd87/xd87.c index da07c71d88b0..e14480b054ae 100644 --- a/keyboards/xd87/xd87.c +++ b/keyboards/xd87/xd87.c @@ -18,7 +18,7 @@ void matrix_init_kb(void) { // put your keyboard start-up code here // runs once when the firmware starts up - + led_init_ports(); matrix_init_user(); } @@ -39,5 +39,15 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { void led_set_kb(uint8_t usb_led) { // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(E2); + } else { + writePinHigh(E2); + } + led_set_user(usb_led); } + +void led_init_ports(void) { + setPinOutput(E2); +}