diff options
author | Nick Brassel <nick@tzarc.org> | 2022-08-28 14:23:01 +1000 |
---|---|---|
committer | Nick Brassel <nick@tzarc.org> | 2022-08-28 14:23:01 +1000 |
commit | 0a3f7e48690bb2b7b008300a54554979a55be19a (patch) | |
tree | 7499d52f20040ed7d5a56496ecb81ed114f80719 /keyboards/crkbd/keymaps/thumb_ctrl | |
parent | fc0bf67f372c38f72c303cdec21b1d4afb5e8cb4 (diff) | |
parent | 9b5b0722555891ba94f240760ef3a6d4c870fd13 (diff) |
Merge remote-tracking branch 'upstream/develop'
Diffstat (limited to 'keyboards/crkbd/keymaps/thumb_ctrl')
-rwxr-xr-x | keyboards/crkbd/keymaps/thumb_ctrl/config.h | 2 | ||||
-rwxr-xr-x | keyboards/crkbd/keymaps/thumb_ctrl/keymap.c | 52 | ||||
-rwxr-xr-x | keyboards/crkbd/keymaps/thumb_ctrl/rules.mk | 8 |
3 files changed, 17 insertions, 45 deletions
diff --git a/keyboards/crkbd/keymaps/thumb_ctrl/config.h b/keyboards/crkbd/keymaps/thumb_ctrl/config.h index 4aee2aed14..10b89aede5 100755 --- a/keyboards/crkbd/keymaps/thumb_ctrl/config.h +++ b/keyboards/crkbd/keymaps/thumb_ctrl/config.h @@ -28,8 +28,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. // #define MASTER_RIGHT // #define EE_HANDS -// #define SSD1306OLED - #define USE_SERIAL_PD2 #define TAPPING_FORCE_HOLD diff --git a/keyboards/crkbd/keymaps/thumb_ctrl/keymap.c b/keyboards/crkbd/keymaps/thumb_ctrl/keymap.c index cbd7a46890..387839c16e 100755 --- a/keyboards/crkbd/keymaps/thumb_ctrl/keymap.c +++ b/keyboards/crkbd/keymaps/thumb_ctrl/keymap.c @@ -4,9 +4,6 @@ #include "lufa.h" #include "split_util.h" #endif -#ifdef SSD1306OLED - #include "ssd1306.h" -#endif extern keymap_config_t keymap_config; @@ -40,7 +37,7 @@ enum custom_keycodes { #define KC_XXXXX KC_NO #define KC_LOWER LOWER #define KC_RAISE RAISE -#define KC_RST RESET +#define KC_RST QK_BOOT #define KC_LRST RGBRST #define KC_LTOG RGB_TOG #define KC_LHUI RGB_HUI @@ -129,14 +126,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(!has_usb()); // 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); @@ -150,42 +142,26 @@ const char *read_keylogs(void); // void set_timelog(void); // const char *read_timelog(void); -void matrix_scan_user(void) { - iota_gfx_task(); -} - -void matrix_render_user(struct CharacterMatrix *matrix) { - if (is_master) { +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_ln(matrix, read_layer_state()); - matrix_write_ln(matrix, read_keylog()); - matrix_write_ln(matrix, read_keylogs()); - //matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); - //matrix_write_ln(matrix, read_host_led_state()); - //matrix_write_ln(matrix, read_timelog()); + oled_write_ln(read_layer_state(), false); + oled_write_ln(read_keylog(), false); + oled_write_ln(read_keylogs(), false); + //oled_write_ln(read_mode_icon(keymap_config.swap_lalt_lgui), false); + //oled_write_ln(read_host_led_state(), false); + //oled_write_ln(read_timelog(), 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 // set_timelog(); diff --git a/keyboards/crkbd/keymaps/thumb_ctrl/rules.mk b/keyboards/crkbd/keymaps/thumb_ctrl/rules.mk index e1d691834d..193aa14dac 100755 --- a/keyboards/crkbd/keymaps/thumb_ctrl/rules.mk +++ b/keyboards/crkbd/keymaps/thumb_ctrl/rules.mk @@ -16,19 +16,17 @@ UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SWAP_HANDS_ENABLE = no # Enable one-hand typing +OLED_ENABLE = yes +OLED_DRIVER = SSD1306 # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # 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 \ # ./lib/mode_icon_reader.c \ # ./lib/host_led_state_reader.c \ # ./lib/timelogger.c \ - -VPATH += keyboards/crkbd/lib -LIB_SRC += ssd1306.c i2c.c |