diff options
Diffstat (limited to 'keyboards/yosino58/lib/host_led_state_reader.c')
-rw-r--r-- | keyboards/yosino58/lib/host_led_state_reader.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/keyboards/yosino58/lib/host_led_state_reader.c b/keyboards/yosino58/lib/host_led_state_reader.c new file mode 100644 index 000000000..2a17e0a33 --- /dev/null +++ b/keyboards/yosino58/lib/host_led_state_reader.c | |||
@@ -0,0 +1,15 @@ | |||
1 | #include <stdio.h> | ||
2 | #include "yosino58.h" | ||
3 | |||
4 | char host_led_state_str[24]; | ||
5 | |||
6 | const char *read_host_led_state(void) | ||
7 | { | ||
8 | uint8_t leds = host_keyboard_leds(); | ||
9 | snprintf(host_led_state_str, sizeof(host_led_state_str), "NL:%s CL:%s SL:%s", | ||
10 | (leds & (1 << USB_LED_NUM_LOCK)) ? "on" : "- ", | ||
11 | (leds & (1 << USB_LED_CAPS_LOCK)) ? "on" : "- ", | ||
12 | (leds & (1 << USB_LED_SCROLL_LOCK)) ? "on" : "- "); | ||
13 | |||
14 | return host_led_state_str; | ||
15 | } | ||