diff options
Diffstat (limited to 'keyboards/crkbd/keymaps/rs/oled.c')
-rw-r--r-- | keyboards/crkbd/keymaps/rs/oled.c | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/keyboards/crkbd/keymaps/rs/oled.c b/keyboards/crkbd/keymaps/rs/oled.c index bd8ae7d299..a4c71daac2 100644 --- a/keyboards/crkbd/keymaps/rs/oled.c +++ b/keyboards/crkbd/keymaps/rs/oled.c @@ -1,13 +1,10 @@ -#ifdef SSD1306OLED +#ifdef OLED_ENABLE #include QMK_KEYBOARD_H -#include "ssd1306.h" #ifdef PROTOCOL_LUFA #include "lufa.h" #include "split_util.h" #endif -extern uint8_t is_master; - // When add source files to SRC in rules.mk, you can use functions. const char *read_logo(void); const char *read_keylog(void); @@ -47,7 +44,6 @@ void update_keymap_status(void) { #endif void matrix_init_user(void) { - iota_gfx_init(!has_usb()); // turns on the display update_keymap_status(); } @@ -74,31 +70,18 @@ layer_state_t layer_state_set_user(layer_state_t state) { } static inline void render_keymap_status(struct CharacterMatrix *matrix) { - matrix_write(matrix, layer_status_buf); + oled_write(layer_status_buf); } -void matrix_render_user(struct CharacterMatrix *matrix) { - if (is_master) { +bool oled_task_user(void) { + if (is_keyboard_master()) { render_keymap_status(matrix); - matrix_write_ln(matrix, read_keylog()); - matrix_write_ln(matrix, read_keylogs()); + oled_write_ln(read_keylog(), false); + oled_write_ln(read_keylogs(), false); } else { - matrix_write(matrix, read_logo()); - } -} - -void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { - if (memcmp(dest->display, source->display, sizeof(dest->display))) { - memcpy(dest->display, source->display, sizeof(dest->display)); - dest->dirty = true; + oled_write(read_logo(), false); } -} - -void iota_gfx_task_user(void) { - struct CharacterMatrix matrix; - matrix_clear(&matrix); - matrix_render_user(&matrix); - matrix_update(&display, &matrix); + return false; } #endif |