2023-03-19 22:12:05 +01:00
|
|
|
#include "quantum.h"
|
2018-08-22 18:51:37 +02:00
|
|
|
#include <stdio.h>
|
2018-06-09 00:28:28 +02:00
|
|
|
|
2019-04-18 23:02:32 +02:00
|
|
|
// in the future, should use (1U<<_LAYER_NAME) instead, but needs to be moved to keymap,c
|
2018-06-09 00:28:28 +02:00
|
|
|
#define L_BASE 0
|
2019-04-18 23:02:32 +02:00
|
|
|
#define L_LOWER 2
|
|
|
|
#define L_RAISE 4
|
|
|
|
#define L_ADJUST 8
|
|
|
|
#define L_ADJUST_TRI 14
|
2018-06-09 00:28:28 +02:00
|
|
|
|
2018-08-22 18:51:37 +02:00
|
|
|
char layer_state_str[24];
|
2018-06-09 00:28:28 +02:00
|
|
|
|
2018-08-22 18:51:37 +02:00
|
|
|
const char *read_layer_state(void) {
|
2018-06-09 00:28:28 +02:00
|
|
|
switch (layer_state)
|
|
|
|
{
|
2018-08-22 18:51:37 +02:00
|
|
|
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:
|
2022-07-31 21:36:30 +02:00
|
|
|
#if defined (LAYER_STATE_32BIT)
|
2018-08-22 18:51:37 +02:00
|
|
|
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Undef-%ld", layer_state);
|
2022-07-31 21:36:30 +02:00
|
|
|
#else
|
|
|
|
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Undef-%d", layer_state);
|
|
|
|
#endif
|
2018-06-09 00:28:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return layer_state_str;
|
|
|
|
}
|