Files
qmk/keyboards/crkbd/lib/host_led_state_reader.c
T

16 lines
442 B
C
Raw Normal View History

#include <stdio.h>
2018-06-09 07:28:28 +09:00
#include "crkbd.h"
char host_led_state_str[24];
2018-06-09 07:28:28 +09:00
const char *read_host_led_state(void)
2018-06-09 07:28:28 +09:00
{
uint8_t leds = host_keyboard_leds();
snprintf(host_led_state_str, sizeof(host_led_state_str), "NL:%s CL:%s SL:%s",
(leds & (1 << USB_LED_NUM_LOCK)) ? "on" : "- ",
(leds & (1 << USB_LED_CAPS_LOCK)) ? "on" : "- ",
(leds & (1 << USB_LED_SCROLL_LOCK)) ? "on" : "- ");
2018-06-09 07:28:28 +09:00
return host_led_state_str;
2018-06-09 07:28:28 +09:00
}