Skip to content

Commit

Permalink
Fix OLED timeout on recent qwiic migrations (#14775)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvecr authored Oct 9, 2021
1 parent ff85eb8 commit f895e96
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
13 changes: 6 additions & 7 deletions keyboards/boston_meetup/2019/2019.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {

__attribute__ ((weak))
void oled_task_user(void) {
oled_write_P(PSTR("BOSTON MK LAYER "), false);
oled_write_P(PSTR("BOSTON MK LAYER"), false);
oled_advance_char();
oled_write_char(get_highest_layer(layer_state) + 0x30, true);

led_t led_state = host_keyboard_led_state();
Expand Down Expand Up @@ -68,6 +69,10 @@ void oled_task_user(void) {
for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
for (uint8_t y = 0; y < MATRIX_COLS; y++) {
bool on = (matrix_get_row(x) & (1 << y)) > 0;

// force on for oled location
if((x == 0) && (y >= (MATRIX_COLS - 2))) on = 1;

oled_write_pixel(MATRIX_DISPLAY_X + y + y + 2, MATRIX_DISPLAY_Y + x + x + 2, on);
oled_write_pixel(MATRIX_DISPLAY_X + y + y + 3, MATRIX_DISPLAY_Y + x + x + 2, on);
oled_write_pixel(MATRIX_DISPLAY_X + y + y + 2, MATRIX_DISPLAY_Y + x + x + 3, on);
Expand All @@ -85,12 +90,6 @@ void oled_task_user(void) {
oled_write_pixel(MATRIX_DISPLAY_X + 12, MATRIX_DISPLAY_Y+y, true);
}

// oled location
for (uint8_t x = 0; x < 6; x++) {
oled_write_pixel(MATRIX_DISPLAY_X + 5 + x, MATRIX_DISPLAY_Y + 2, true);
oled_write_pixel(MATRIX_DISPLAY_X + 5 + x, MATRIX_DISPLAY_Y + 3, true);
}

// bodge for layer number left hand side
for (uint8_t y = 0; y < 8; y++) {
oled_write_pixel(95, 0 + y, true);
Expand Down
12 changes: 6 additions & 6 deletions keyboards/hadron/ver3/ver3.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {

__attribute__ ((weak))
void oled_task_user(void) {
oled_write_P(PSTR("LAYER "), false);
oled_write_P(PSTR("LAYER"), false);
oled_advance_char();
oled_write_char(get_highest_layer(layer_state) + 0x30, true);

led_t led_state = host_keyboard_led_state();
Expand Down Expand Up @@ -71,6 +72,10 @@ void oled_task_user(void) {
for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
for (uint8_t y = 0; y < MATRIX_COLS; y++) {
bool on = (matrix_get_row(x) & (1 << y)) > 0;

// force on for oled location
if((x == 0) && (y >= (MATRIX_COLS - 3))) on = 1;

oled_write_pixel(MATRIX_DISPLAY_X + y + 2, MATRIX_DISPLAY_Y + x + 2, on);
}
}
Expand All @@ -85,11 +90,6 @@ void oled_task_user(void) {
oled_write_pixel(MATRIX_DISPLAY_X + 19, MATRIX_DISPLAY_Y+y, true);
}

// oled location
for (uint8_t x = 0; x < 3; x++) {
oled_write_pixel(MATRIX_DISPLAY_X + 14 + x, MATRIX_DISPLAY_Y + 2, true);
}

// bodge for layer number left hand side
for (uint8_t y = 0; y < 8; y++) {
oled_write_pixel(35, 0 + y, true);
Expand Down

0 comments on commit f895e96

Please sign in to comment.