Skip to content

Commit

Permalink
[Keyboard] Reduce nibble oled_status keymap size (qmk#13813)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaygreco authored and nhongooi committed Dec 5, 2021
1 parent a8bfe90 commit 11b2f8c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions keyboards/nullbitsco/nibble/keymaps/oled_status/oled_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 11b2f8c

Please sign in to comment.