浏览代码

Implement NUMLOCK indicator light for XD96 (#6581)

Ceremony 5 年之前
父节点
当前提交
a0f248c20e
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      keyboards/xd96/xd96.c

+ 8 - 0
keyboards/xd96/xd96.c

@@ -16,9 +16,11 @@
 #include "xd96.h"
 #include "xd96.h"
 
 
 #define CAPS_PIN B6
 #define CAPS_PIN B6
+#define NUMLOCK_PIN C6
 
 
 void keyboard_pre_init_kb(void) {
 void keyboard_pre_init_kb(void) {
   setPinOutput(CAPS_PIN);
   setPinOutput(CAPS_PIN);
+  setPinOutput(NUMLOCK_PIN);
 
 
   keyboard_pre_init_user();
   keyboard_pre_init_user();
 }
 }
@@ -29,6 +31,12 @@ void led_set_kb(uint8_t usb_led) {
   } else {
   } else {
     writePinHigh(CAPS_PIN);
     writePinHigh(CAPS_PIN);
   }
   }
+  
+  if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) {
+    writePinLow(NUMLOCK_PIN);
+  } else {
+    writePinHigh(NUMLOCK_PIN);
+  }
 
 
   led_set_user(usb_led);
   led_set_user(usb_led);
 }
 }