Skip to content

Commit

Permalink
fix link error for helix/rev3_5rows:five_rows (#14466)
Browse files Browse the repository at this point in the history
This is a tentative quick fix.
I was adding the same functions for both #14426 and #14427 and they were in conflict.
  • Loading branch information
mtei committed Sep 18, 2021
1 parent 7c09b26 commit f93597d
Showing 1 changed file with 4 additions and 49 deletions.
53 changes: 4 additions & 49 deletions keyboards/helix/rev3_5rows/keymaps/five_rows/oled_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
#include <string.h>
#include "layer_number.h"

char *sprints(char *buf, char *src);
char *sprintd(char *buf, char *leadstr, int data);
char *sprint2d(char *buf, char *leadstr, int data);

extern int current_default_layer;

void init_helix_oled(void) {
Expand Down Expand Up @@ -64,55 +68,6 @@ void matrix_update(struct CharacterMatrix *dest,
}
# endif

static char *sprint_decimal(char *buf, int data) {
if (data > 9) {
buf = sprint_decimal(buf, data/10);
}
*buf++ = "0123456789"[data%10];
*buf = '\0';
return buf;
}

static char *sprint_hex(char *buf, uint32_t data) {
if (data > 0xf) {
buf = sprint_hex(buf, data/0x10);
}
*buf++ = "0123456789abcdef"[data & 0xf];
*buf = '\0';
return buf;
}

char *sprints(char *buf, char *src) {
while (*src) {
*buf++ = *src++;
}
*buf = '\0';
return buf;
}

char *sprintx(char *buf, char *leadstr, uint32_t data) {
buf = sprints(buf, leadstr);
buf = sprint_hex(buf, data);
return buf;
}

char *sprintd(char *buf, char *leadstr, int data) {
buf = sprints(buf, leadstr);
buf = sprint_decimal(buf, data);
return buf;
}

char *sprint2d(char *buf, char *leadstr, int data) {
buf = sprints(buf, leadstr);
if (data > 99) {
return sprint_decimal(buf, data);
}
if (data < 10) {
*buf++ = ' ';
}
return sprint_decimal(buf, data);
}

# ifdef SSD1306OLED
static void render_logo(struct CharacterMatrix *matrix) {
# else
Expand Down

0 comments on commit f93597d

Please sign in to comment.