diff options
Diffstat (limited to 'keyboards/crkbd/keymaps/vlukash_trackpad_left')
-rw-r--r-- | keyboards/crkbd/keymaps/vlukash_trackpad_left/config.h | 3 | ||||
-rw-r--r-- | keyboards/crkbd/keymaps/vlukash_trackpad_left/keymap.c | 45 | ||||
-rw-r--r-- | keyboards/crkbd/keymaps/vlukash_trackpad_left/rules.mk | 8 |
3 files changed, 12 insertions, 44 deletions
diff --git a/keyboards/crkbd/keymaps/vlukash_trackpad_left/config.h b/keyboards/crkbd/keymaps/vlukash_trackpad_left/config.h index d1c3855402..94494bafd8 100644 --- a/keyboards/crkbd/keymaps/vlukash_trackpad_left/config.h +++ b/keyboards/crkbd/keymaps/vlukash_trackpad_left/config.h @@ -5,9 +5,6 @@ #define MASTER_RIGHT // #define EE_HANDS -#define SSD1306OLED -#define USE_SSD_I2C - #define USE_SERIAL_PD2 #define TAPPING_FORCE_HOLD diff --git a/keyboards/crkbd/keymaps/vlukash_trackpad_left/keymap.c b/keyboards/crkbd/keymaps/vlukash_trackpad_left/keymap.c index 7940e28025..eb30873f5b 100644 --- a/keyboards/crkbd/keymaps/vlukash_trackpad_left/keymap.c +++ b/keyboards/crkbd/keymaps/vlukash_trackpad_left/keymap.c @@ -4,9 +4,6 @@ #include "lufa.h" #include "split_util.h" #endif -#ifdef SSD1306OLED - #include "ssd1306.h" -#endif #ifdef RGBLIGHT_ENABLE //Following line allows macro to read current RGB settings @@ -122,14 +119,9 @@ void matrix_init_user(void) { #ifdef RGBLIGHT_ENABLE RGB_current_mode = rgblight_config.mode; #endif - //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h - #ifdef SSD1306OLED - iota_gfx_init(); // turns on the display - #endif } -//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h -#ifdef SSD1306OLED +#ifdef OLED_ENABLE // When add source files to SRC in rules.mk, you can use functions. const char *read_layer_state(void); @@ -138,42 +130,23 @@ void set_keylog(uint16_t keycode, keyrecord_t *record); const char *read_keylog(void); const char *read_keylogs(void); -void matrix_scan_user(void) { - iota_gfx_task(); -} - -void matrix_render_user(struct CharacterMatrix *matrix) { +bool oled_task_user(void) { if (is_keyboard_master()) { // If you want to change the display of OLED, you need to change here - matrix_write(matrix, read_layer_state()); - matrix_write(matrix, "\n"); - matrix_write(matrix, read_keylog()); - matrix_write(matrix, "\n"); - matrix_write(matrix, read_keylogs()); - matrix_write(matrix, "\n"); + 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()); + oled_write(read_logo(), false); } + return false; } -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; - } -} - -void iota_gfx_task_user(void) { - struct CharacterMatrix matrix; - matrix_clear(&matrix); - matrix_render_user(&matrix); - matrix_update(&display, &matrix); -} -#endif//SSD1306OLED +#endif bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { -#ifdef SSD1306OLED +#ifdef OLED_ENABLE set_keylog(keycode, record); #endif } diff --git a/keyboards/crkbd/keymaps/vlukash_trackpad_left/rules.mk b/keyboards/crkbd/keymaps/vlukash_trackpad_left/rules.mk index 44ff63ada1..ed4d34a70b 100644 --- a/keyboards/crkbd/keymaps/vlukash_trackpad_left/rules.mk +++ b/keyboards/crkbd/keymaps/vlukash_trackpad_left/rules.mk @@ -1,14 +1,12 @@ # Build Options RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +OLED_ENABLE = yes +OLED_DRIVER = SSD1306 BOOTLOADER = atmel-dfu # If you want to change the display of OLED, you need to change here -SRC += ./lib/glcdfont.c \ - ./lib/rgb_state_reader.c \ +SRC += ./lib/rgb_state_reader.c \ ./lib/layer_state_reader.c \ ./lib/logo_reader.c \ ./lib/keylogger.c \ - -VPATH += keyboards/crkbd/lib -LIB_SRC += ssd1306.c i2c.c |