From 6eb4e4ba5dc1ffe2d0acce952e1d20a2cce57199 Mon Sep 17 00:00:00 2001 From: Kai Ryu Date: Fri, 23 May 2014 18:49:11 +0900 Subject: [PATCH] Correct capslock led and add new "numlock" led --- common/action_layer.c | 3 +++ common/action_layer.h | 2 ++ keyboard/akb96/led.c | 20 ++++++++++++++++++-- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/common/action_layer.c b/common/action_layer.c index 526e24d5..ac02ba0f 100644 --- a/common/action_layer.c +++ b/common/action_layer.c @@ -64,6 +64,9 @@ static void layer_state_set(uint32_t state) layer_state = state; layer_debug(); dprintln(); clear_keyboard_but_mods(); // To avoid stuck keys +#ifdef ON_LAYER_CHANGE + layer_change(layer_state); +#endif } void layer_clear(void) diff --git a/common/action_layer.h b/common/action_layer.h index 034e0002..503ebc06 100644 --- a/common/action_layer.h +++ b/common/action_layer.h @@ -56,6 +56,7 @@ void layer_invert(uint8_t layer); void layer_or(uint32_t state); void layer_and(uint32_t state); void layer_xor(uint32_t state); +void layer_change(uint32_t state); #else #define layer_state 0 #define layer_clear() @@ -68,6 +69,7 @@ void layer_xor(uint32_t state); #define layer_and(state) #define layer_xor(state) #define layer_debug() +#define layer_change(state) #endif diff --git a/keyboard/akb96/led.c b/keyboard/akb96/led.c index 1b00a5a0..a210abeb 100644 --- a/keyboard/akb96/led.c +++ b/keyboard/akb96/led.c @@ -18,6 +18,7 @@ along with this program. If not, see . #include #include "stdint.h" #include "led.h" +#include "action_layer.h" /* LED pin configration @@ -27,12 +28,27 @@ along with this program. If not, see . void led_set(uint8_t usb_led) { if (usb_led & (1<