[Keyboard] Reduce nibble oled_status keymap size (#13813)

This commit is contained in:
Jay Greco 2021-07-31 06:11:11 -07:00 committed by GitHub
parent e755c5fe1f
commit 56200de2eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,7 +13,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <stdio.h>
#include "quantum.h" #include "quantum.h"
#include "oled_display.h" #include "oled_display.h"
@ -62,11 +61,14 @@ void process_record_keymap_oled(uint16_t keycode) {
} }
void render_wpm(void) { void render_wpm(void) {
char wpm_str[10]; uint8_t n = get_current_wpm();
char wpm_counter[4];
sprintf(wpm_str, "%03d", get_current_wpm()); 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_P(PSTR(" "), false);
oled_write(wpm_str, false); oled_write(wpm_counter, false);
} }
void render_idle(void) { void render_idle(void) {