fix: improper usage of keyboard/user-level functions (#22652)

This commit is contained in:
Less/Rikki 2023-12-13 13:33:15 -05:00 committed by GitHub
parent 05d2b7e2ac
commit 49527afc6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 182 additions and 161 deletions

View file

@ -20,18 +20,21 @@
#include "lib/bongocat.h"
#ifdef OLED_ENABLE
bool oled_task_kb(void) {
led_t led_usb_state = host_keyboard_led_state();
render_bongocat();
oled_set_cursor(14, 0); // sets cursor to (column, row) using charactar spacing (4 rows on 128x32 screen, anything more will overflow back to the top)
oled_write_P(PSTR("WPM:"), false);
oled_write(get_u8_str(get_current_wpm(), '0'), false); // writes wpm on top right corner of string
oled_set_cursor(17, 2);
oled_write_P(led_usb_state.caps_lock ? PSTR("CAPS") : PSTR(" "), false);
oled_set_cursor(17, 3);
oled_write_P(led_usb_state.scroll_lock ? PSTR("SCRL") : PSTR(" "), false);
return true;
bool oled_task_kb(void) {
if (!oled_task_user()) {
return false;
}
led_t led_usb_state = host_keyboard_led_state();
render_bongocat();
oled_set_cursor(14, 0); // sets cursor to (column, row) using charactar spacing (4 rows on 128x32 screen, anything more will overflow back to the top)
oled_write_P(PSTR("WPM:"), false);
oled_write(get_u8_str(get_current_wpm(), '0'), false); // writes wpm on top right corner of string
oled_set_cursor(17, 2);
oled_write_P(led_usb_state.caps_lock ? PSTR("CAPS") : PSTR(" "), false);
oled_set_cursor(17, 3);
oled_write_P(led_usb_state.scroll_lock ? PSTR("SCRL") : PSTR(" "), false);
return true;
}
#endif