qmk_firmware/keyboards/crkbd/keymaps/lib/layer_state_reader.c
Kosuke Adachi 710937e4ef Add corne keyboard (#3119)
* Fork from helix

* Move rev2 to rev1

* Remove unused settings

* Move split_util to outof rev

* Setup KEYMAP for crkbd

* Remove old image

* Move keymaps directory and glcdfont.c

* Remove AUDIO in keymap

* Show keylog

* Show keylogs

* Show time log

* Remove EISU/KANA

* Use KEYMAP_kc

* Remove iota_gfx_record_user wrapping

* Remove unused settings for layer

* Add keylogger.c

* Fix uppercase letters to lower

* Add timelogger.c

* Default RGBLED_NUM = 27

* Remove unused setting

* Add mode icon reader

* Add matrix_write_ln

* Add layer_state_reader

* Move to lib directory

* Rename functions

* Add host_led_state_reader

* Add logo_reader

* Cleaning of iota_gfx_task

* Fix bugs and add key defines

* Remove unnecessary comments

* Update crkbd readme

* Move libs to lib directories

* Rename KEYMAP to LAYOUT
2018-06-08 15:28:28 -07:00

33 lines
801 B
C

#include "crkbd.h"
#define L_BASE 0
#define L_LOWER 8
#define L_RAISE 16
#define L_ADJUST 65536
#define L_ADJUST_TRI 65560
char layer_state_str[40];
char *read_layer_state(void)
{
switch (layer_state)
{
case L_BASE:
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Default");
break;
case L_RAISE:
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Raise");
break;
case L_LOWER:
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Lower");
break;
case L_ADJUST:
case L_ADJUST_TRI:
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Adjust");
break;
default:
snprintf(layer_state_str,sizeof(layer_state_str), "Layer: Undef-%ld", layer_state);
}
return layer_state_str;
}