|
@@ -8,8 +8,6 @@
|
|
|
#include "ssd1306.h"
|
|
|
#endif
|
|
|
|
|
|
-
|
|
|
-
|
|
|
#ifdef RGBLIGHT_ENABLE
|
|
|
|
|
|
extern rgblight_config_t rgblight_config;
|
|
@@ -135,16 +133,18 @@ void matrix_init_user(void) {
|
|
|
#ifdef RGBLIGHT_ENABLE
|
|
|
RGB_current_mode = rgblight_config.mode;
|
|
|
#endif
|
|
|
-
|
|
|
- #ifdef SSD1306OLED
|
|
|
- iota_gfx_init(!has_usb());
|
|
|
- #endif
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-#ifdef SSD1306OLED
|
|
|
+
|
|
|
+#ifdef OLED_DRIVER_ENABLE
|
|
|
|
|
|
-
|
|
|
+oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
|
|
+ if (!is_keyboard_master())
|
|
|
+ return OLED_ROTATION_180;
|
|
|
+ return rotation;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
const char *read_layer_state(void);
|
|
|
const char *read_logo(void);
|
|
|
void set_keylog(uint16_t keycode, keyrecord_t *record);
|
|
@@ -156,42 +156,24 @@ const char *read_keylogs(void);
|
|
|
|
|
|
|
|
|
|
|
|
-void matrix_scan_user(void) {
|
|
|
- iota_gfx_task();
|
|
|
-}
|
|
|
-
|
|
|
-void matrix_render_user(struct CharacterMatrix *matrix) {
|
|
|
- if (is_master) {
|
|
|
+void oled_task_user(void) {
|
|
|
+ if (is_keyboard_master()) {
|
|
|
|
|
|
- matrix_write_ln(matrix, read_layer_state());
|
|
|
- matrix_write_ln(matrix, read_keylog());
|
|
|
- matrix_write_ln(matrix, read_keylogs());
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ oled_write_ln(read_layer_state(), false);
|
|
|
+ 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);
|
|
|
-}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
|
|
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|
|
if (record->event.pressed) {
|
|
|
-#ifdef SSD1306OLED
|
|
|
+#ifdef OLED_DRIVER_ENABLE
|
|
|
set_keylog(keycode, record);
|
|
|
#endif
|
|
|
|