From d9f287586635a401b8d6a80614bee6dbebe2f18c Mon Sep 17 00:00:00 2001 From: tmk Date: Fri, 15 Feb 2013 18:48:36 +0900 Subject: Replace layer_stack with layer_switch --- common/layer_switch.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 common/layer_switch.c (limited to 'common/layer_switch.c') diff --git a/common/layer_switch.c b/common/layer_switch.c new file mode 100644 index 0000000000..9bc804e641 --- /dev/null +++ b/common/layer_switch.c @@ -0,0 +1,68 @@ +#include +#include "keyboard.h" +#include "action.h" +#include "debug.h" +#include "layer_switch.h" + + +uint16_t layer_switch_stat = 0; + + +uint16_t layer_switch_stat_get(void) +{ + return layer_switch_stat; +} + +void layer_switch_stat_set(uint16_t stat) +{ + layer_switch_stat = stat; + layer_switch_debug(); +} + +void layer_switch_clear(void) +{ + layer_switch_stat = 0; + layer_switch_debug(); +} + +void layer_switch_on(uint8_t layer) +{ + layer_switch_stat |= (1<= 0; i--) { + if (layer_switch_stat & (1<