diff --git a/users/plodah/functions/oled.c b/users/plodah/functions/oled.c new file mode 100644 index 0000000000..654d8ca207 --- /dev/null +++ b/users/plodah/functions/oled.c @@ -0,0 +1,32 @@ +#ifdef OLED_ENABLE +bool oled_task_user(void) { + // Host Keyboard Layer Status + oled_write_P(PSTR("Layer: "), false); + + switch (get_highest_layer(layer_state)) { + case _QWERTY: + oled_write_P(PSTR("QWE\n"), false); + break; + case _COLEMAK: + oled_write_P(PSTR("COL\n"), false); + break; + case _FN_A: + oled_write_P(PSTR("FnA\n"), false); + break; + case _FN_B: + oled_write_P(PSTR("FnB\n"), false); + break; + default: + // Or use the write_ln shortcut over adding '\n' to the end of your string + oled_write_ln_P(PSTR("???"), false); + } + + // Host Keyboard LED Status + led_t led_state = host_keyboard_led_state(); + oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); + oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); + oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); + + return false; +} +#endif diff --git a/users/plodah/plodah.c b/users/plodah/plodah.c index 8e1c7f6b68..1964b733c7 100644 --- a/users/plodah/plodah.c +++ b/users/plodah/plodah.c @@ -44,6 +44,7 @@ #include "functions/dipswitch.c" #include "functions/dynamic_macros.c" #include "functions/mouse_jiggler.c" +#include "functions/oled.c" #include "functions/repeathold_rgb.c" #include "functions/tapdance.c" #include "functions/textfns.c"