summaryrefslogtreecommitdiff
path: root/keyboards/crkbd/keymaps/rs/oled.c
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2022-08-28 14:23:01 +1000
committerNick Brassel <nick@tzarc.org>2022-08-28 14:23:01 +1000
commit0a3f7e48690bb2b7b008300a54554979a55be19a (patch)
tree7499d52f20040ed7d5a56496ecb81ed114f80719 /keyboards/crkbd/keymaps/rs/oled.c
parentfc0bf67f372c38f72c303cdec21b1d4afb5e8cb4 (diff)
parent9b5b0722555891ba94f240760ef3a6d4c870fd13 (diff)
Merge remote-tracking branch 'upstream/develop'
Diffstat (limited to 'keyboards/crkbd/keymaps/rs/oled.c')
-rw-r--r--keyboards/crkbd/keymaps/rs/oled.c33
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