diff options
author | Nick Brassel <nick@tzarc.org> | 2021-08-02 13:55:36 +1000 |
---|---|---|
committer | Nick Brassel <nick@tzarc.org> | 2021-08-02 13:55:36 +1000 |
commit | ee3c138385a2644b162807ef05261936858a7e25 (patch) | |
tree | f7036343619a43c28250b12499dfc404cdc31a50 /keyboards/nullbitsco | |
parent | 26b62f7a6c4e5dd98e9a1e7b60c7e3a927e00ec2 (diff) | |
parent | 4b630c46fed48f8a82641438029b628ec0dd5150 (diff) |
Merge remote-tracking branch 'upstream/master' into develop
Diffstat (limited to 'keyboards/nullbitsco')
-rw-r--r-- | keyboards/nullbitsco/nibble/keymaps/oled_status/oled_display.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/keyboards/nullbitsco/nibble/keymaps/oled_status/oled_display.c b/keyboards/nullbitsco/nibble/keymaps/oled_status/oled_display.c index 1b132a9e62..c734e80cef 100644 --- a/keyboards/nullbitsco/nibble/keymaps/oled_status/oled_display.c +++ b/keyboards/nullbitsco/nibble/keymaps/oled_status/oled_display.c @@ -13,7 +13,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include <stdio.h> #include "quantum.h" #include "oled_display.h" @@ -62,11 +61,14 @@ void process_record_keymap_oled(uint16_t keycode) { } void render_wpm(void) { - char wpm_str[10]; - - sprintf(wpm_str, "%03d", get_current_wpm()); + uint8_t n = get_current_wpm(); + char wpm_counter[4]; + wpm_counter[3] = '\0'; + wpm_counter[2] = '0' + n % 10; + wpm_counter[1] = '0' + (n /= 10) % 10; + wpm_counter[0] = '0' + n / 10 ; oled_write_P(PSTR(" "), false); - oled_write(wpm_str, false); + oled_write(wpm_counter, false); } void render_idle(void) { |