diff options
author | QMK Bot <hello@qmk.fm> | 2021-05-30 21:48:16 +0000 |
---|---|---|
committer | QMK Bot <hello@qmk.fm> | 2021-05-30 21:48:16 +0000 |
commit | 160f9144c2e50afb0547fe24526595460c49518e (patch) | |
tree | 48b8ca3726724cc8ede6eb84cf2ac5b975c84288 | |
parent | 0d74ed3c35afef7e4d2b13a47e9e310183eb85d2 (diff) | |
parent | 3aca3d35729bd7445846918cb5a171c5e0093997 (diff) |
Merge remote-tracking branch 'origin/master' into develop
-rw-r--r-- | keyboards/merge/um70/keymaps/via/keymap.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/keyboards/merge/um70/keymaps/via/keymap.c b/keyboards/merge/um70/keymaps/via/keymap.c index 59483e64a4..17cb2895cb 100644 --- a/keyboards/merge/um70/keymaps/via/keymap.c +++ b/keyboards/merge/um70/keymaps/via/keymap.c @@ -15,7 +15,6 @@ */ #include QMK_KEYBOARD_H -#include <stdio.h> enum layer_names { _BASE, @@ -123,7 +122,7 @@ static const char PROGMEM merge_logo[] = { 0x01, 0x00, 0x01, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 }; -int current_wpm = 0; +uint8_t current_wpm = 0; static void print_status_narrow(void) { oled_set_cursor(0,1); @@ -159,10 +158,15 @@ static void print_status_narrow(void) { //oled_write_ln_P(PSTR(" "), false); oled_write_P(PSTR("-----"), false); - // WPM counter Start (Need #include <stdio.h> to work) - char wpm_str[8]; + // WPM counter Start + char wpm_str[5]; oled_set_cursor(0,13); - sprintf(wpm_str, " %03d", current_wpm); + wpm_str[4] = '\0'; + uint8_t n = current_wpm; + wpm_str[3] = '0' + n % 10; + wpm_str[2] = '0' + (n /= 10) % 10; + wpm_str[1] = '0' + n / 10; + wpm_str[0] = ' '; oled_write(wpm_str, false); oled_set_cursor(0,14); oled_write(" WPM ", false); |