diff options
| -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 59483e64a..17cb2895c 100644 --- a/keyboards/merge/um70/keymaps/via/keymap.c +++ b/keyboards/merge/um70/keymaps/via/keymap.c | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | */ | 15 | */ |
| 16 | 16 | ||
| 17 | #include QMK_KEYBOARD_H | 17 | #include QMK_KEYBOARD_H |
| 18 | #include <stdio.h> | ||
| 19 | 18 | ||
| 20 | enum layer_names { | 19 | enum layer_names { |
| 21 | _BASE, | 20 | _BASE, |
| @@ -123,7 +122,7 @@ static const char PROGMEM merge_logo[] = { | |||
| 123 | 0x01, 0x00, 0x01, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 | 122 | 0x01, 0x00, 0x01, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 |
| 124 | }; | 123 | }; |
| 125 | 124 | ||
| 126 | int current_wpm = 0; | 125 | uint8_t current_wpm = 0; |
| 127 | 126 | ||
| 128 | static void print_status_narrow(void) { | 127 | static void print_status_narrow(void) { |
| 129 | oled_set_cursor(0,1); | 128 | oled_set_cursor(0,1); |
| @@ -159,10 +158,15 @@ static void print_status_narrow(void) { | |||
| 159 | //oled_write_ln_P(PSTR(" "), false); | 158 | //oled_write_ln_P(PSTR(" "), false); |
| 160 | oled_write_P(PSTR("-----"), false); | 159 | oled_write_P(PSTR("-----"), false); |
| 161 | 160 | ||
| 162 | // WPM counter Start (Need #include <stdio.h> to work) | 161 | // WPM counter Start |
| 163 | char wpm_str[8]; | 162 | char wpm_str[5]; |
| 164 | oled_set_cursor(0,13); | 163 | oled_set_cursor(0,13); |
| 165 | sprintf(wpm_str, " %03d", current_wpm); | 164 | wpm_str[4] = '\0'; |
| 165 | uint8_t n = current_wpm; | ||
| 166 | wpm_str[3] = '0' + n % 10; | ||
| 167 | wpm_str[2] = '0' + (n /= 10) % 10; | ||
| 168 | wpm_str[1] = '0' + n / 10; | ||
| 169 | wpm_str[0] = ' '; | ||
| 166 | oled_write(wpm_str, false); | 170 | oled_write(wpm_str, false); |
| 167 | oled_set_cursor(0,14); | 171 | oled_set_cursor(0,14); |
| 168 | oled_write(" WPM ", false); | 172 | oled_write(" WPM ", false); |
