host_led_state_reader.c 444 B

1234567891011121314151617
  1. #include <stdio.h>
  2. #include "led.h"
  3. #include "host.h"
  4. #include "lily58.h"
  5. char host_led_state_str[24];
  6. const char *read_host_led_state(void)
  7. {
  8. led_t led_state = host_keyboard_led_state();
  9. snprintf(host_led_state_str, sizeof(host_led_state_str), "NL:%s CL:%s SL:%s",
  10. led_state.num_lock ? "on" : "- ",
  11. led_state.caps_lock ? "on" : "- ",
  12. led_state.scroll_lock ? "on" : "- ");
  13. return host_led_state_str;
  14. }