diff options
author | Jay Greco <jayv.greco@gmail.com> | 2021-07-22 21:45:17 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-22 21:45:17 -0700 |
commit | a08c7087bef89b8b23e7462ece413a1861f8e4af (patch) | |
tree | e07e461a1777234905557f68a6231d299c9d9a9c | |
parent | dfd795e48eda882320a50479adcfa9dddceec564 (diff) |
[Keymap] Reduce NIBBLE oled_bongocat keymap size so it compiles (#13638)
-rw-r--r-- | keyboards/nullbitsco/nibble/keymaps/oled_bongocat/keymap.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/keyboards/nullbitsco/nibble/keymaps/oled_bongocat/keymap.c b/keyboards/nullbitsco/nibble/keymaps/oled_bongocat/keymap.c index 1d8559627a..d9365f54bf 100644 --- a/keyboards/nullbitsco/nibble/keymaps/oled_bongocat/keymap.c +++ b/keyboards/nullbitsco/nibble/keymaps/oled_bongocat/keymap.c @@ -17,8 +17,6 @@ */ #include QMK_KEYBOARD_H #include "animation_frames.h" -#include <stdio.h> - enum layer_names { _BASE, @@ -97,7 +95,6 @@ uint32_t anim_timer = 0; uint32_t anim_sleep = 0; uint8_t current_idle_frame = 0; -char wpm_str[10]; bool tap_anim = false; bool tap_anim_toggle = false; @@ -161,8 +158,16 @@ static void render_anim(void) { void oled_task_user(void) { render_anim(); oled_set_cursor(0, 14); - sprintf(wpm_str, ">%04d", get_current_wpm()); - oled_write_ln(wpm_str, false); + + uint8_t n = get_current_wpm(); + char wpm_counter[6]; + wpm_counter[5] = '\0'; + wpm_counter[4] = '0' + n % 10; + wpm_counter[3] = '0' + (n /= 10) % 10; + wpm_counter[2] = '0' + n / 10 ; + wpm_counter[1] = '0'; + wpm_counter[0] = '>'; + oled_write_ln(wpm_counter, false); } #endif |