[Core] Refactor OLED to allow easy addition of other types (#13454)
* add docs * core changes * update keyboards to new OLED * updated users to new OLED * update layouts to new OLED * fixup docs * drashna's suggestion * fix up docs * new keyboards with oled * core split changes * remaining keyboard files * Fix The Helix keyboards oled options * reflect develop Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: mtei <2170248+mtei@users.noreply.github.com>
This commit is contained in:
parent
6fd20acf4b
commit
4e1c5887c5
500 changed files with 1579 additions and 1387 deletions
|
@ -124,8 +124,8 @@ void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) {
|
|||
}
|
||||
}
|
||||
|
||||
// SSD1306 OLED update loop, make sure to enable OLED_DRIVER_ENABLE=yes in rules.mk
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
// SSD1306 OLED update loop, make sure to enable OLED_ENABLE=yes in rules.mk
|
||||
#ifdef OLED_ENABLE
|
||||
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
if (!is_keyboard_master()) return OLED_ROTATION_180; // flips the display 180 degrees if offhand
|
||||
|
@ -180,11 +180,11 @@ void oled_task_user(void) {
|
|||
oled_write(read_logo(), false);
|
||||
}
|
||||
}
|
||||
#endif // OLED_DRIVER_ENABLE
|
||||
#endif // OLED_ENABLE
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (record->event.pressed) {
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
#ifdef OLED_ENABLE
|
||||
set_keylog(keycode, record);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -130,7 +130,7 @@ void matrix_init_user(void) {
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
#ifdef OLED_ENABLE
|
||||
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
if (!is_keyboard_master())
|
||||
|
@ -169,7 +169,7 @@ void oled_task_user(void) {
|
|||
// oled_write_ln(encoder_debug, false);
|
||||
}
|
||||
}
|
||||
#endif //OLED_DRIVER_ENABLE
|
||||
#endif //OLED_ENABLE
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (record->event.pressed) {
|
||||
|
|
|
@ -10,7 +10,7 @@ COMMAND_ENABLE = no
|
|||
RGBLIGHT_ENABLE = no
|
||||
RGB_MATRIX_ENABLE = no
|
||||
|
||||
OLED_DRIVER_ENABLE = yes
|
||||
OLED_ENABLE = yes
|
||||
|
||||
BOOTLOADER = atmel-dfu
|
||||
SPLIT_TRANSPORT = mirror
|
||||
|
|
|
@ -105,7 +105,7 @@ bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) {
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
#ifdef OLED_ENABLE
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
if (!is_keyboard_master())
|
||||
return OLED_ROTATION_180;
|
||||
|
@ -117,5 +117,5 @@ const char *read_logo(void);
|
|||
void oled_task_user(void) {
|
||||
oled_write_ln(read_logo(), false);
|
||||
}
|
||||
#endif // OLED_DRIVER_ENABLE
|
||||
#endif // OLED_ENABLE
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
AUTO_SHIFT_ENABLE = no
|
||||
OLED_DRIVER_ENABLE= yes
|
||||
OLED_ENABLE= yes
|
||||
|
||||
EXTRAKEY_ENABLE = yes
|
||||
|
||||
SRC += ./lib/logo_reader.c
|
||||
SRC += ./lib/logo_reader.c
|
||||
# ./lib/keylogger.c \
|
||||
# ./lib/mode_icon_reader.c \
|
||||
# ./lib/timelogger.c \
|
||||
|
|
|
@ -114,8 +114,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
)
|
||||
};
|
||||
|
||||
//SSD1306 OLED update loop, make sure to enable OLED_DRIVER_ENABLE=yes in rules.mk
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
//SSD1306 OLED update loop, make sure to enable OLED_ENABLE=yes in rules.mk
|
||||
#ifdef OLED_ENABLE
|
||||
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
if (!is_keyboard_master())
|
||||
|
@ -226,11 +226,11 @@ void oled_task_user(void) {
|
|||
render_lfc_logo();
|
||||
}
|
||||
}
|
||||
#endif // OLED_DRIVER_ENABLE
|
||||
#endif // OLED_ENABLE
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (record->event.pressed) {
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
#ifdef OLED_ENABLE
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -101,8 +101,8 @@ layer_state_t layer_state_set_user(layer_state_t state) {
|
|||
return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
|
||||
}
|
||||
|
||||
//SSD1306 OLED update loop, make sure to enable OLED_DRIVER_ENABLE=yes in rules.mk
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
//SSD1306 OLED update loop, make sure to enable OLED_ENABLE=yes in rules.mk
|
||||
#ifdef OLED_ENABLE
|
||||
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
if (!is_keyboard_master())
|
||||
|
@ -135,11 +135,11 @@ void oled_task_user(void) {
|
|||
oled_write(read_logo(), false);
|
||||
}
|
||||
}
|
||||
#endif // OLED_DRIVER_ENABLE
|
||||
#endif // OLED_ENABLE
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (record->event.pressed) {
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
#ifdef OLED_ENABLE
|
||||
set_keylog(keycode, record);
|
||||
#endif
|
||||
// set_timelog();
|
||||
|
|
|
@ -13,9 +13,9 @@ MIDI_ENABLE = no # MIDI controls
|
|||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
SWAP_HANDS_ENABLE = no # Enable one-hand typing
|
||||
OLED_DRIVER_ENABLE= yes # OLED display
|
||||
OLED_ENABLE= yes # OLED display
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
|
|
@ -71,8 +71,8 @@ void matrix_init_user(void) {
|
|||
#endif
|
||||
}
|
||||
|
||||
//SSD1306 OLED update loop, make sure to enable OLED_DRIVER_ENABLE=yes in rules.mk
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
//SSD1306 OLED update loop, make sure to enable OLED_ENABLE=yes in rules.mk
|
||||
#ifdef OLED_ENABLE
|
||||
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
if (!is_keyboard_master())
|
||||
|
@ -105,11 +105,11 @@ void oled_task_user(void) {
|
|||
oled_write(read_logo(), false);
|
||||
}
|
||||
}
|
||||
#endif // OLED_DRIVER_ENABLE
|
||||
#endif // OLED_ENABLE
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (record->event.pressed) {
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
#ifdef OLED_ENABLE
|
||||
set_keylog(keycode, record);
|
||||
#endif
|
||||
// set_timelog();
|
||||
|
|
|
@ -12,7 +12,8 @@ AUDIO_ENABLE = no # Audio output
|
|||
BLUETOOTH_ENABLE = no # Enable Bluetooth
|
||||
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
||||
SWAP_HANDS_ENABLE = no # Enable one-hand typing
|
||||
OLED_DRIVER_ENABLE = yes # OLED display
|
||||
OLED_ENABLE = yes
|
||||
OLED_DRIVER = SSD1306 # OLED display
|
||||
ENCODER_ENABLE = yes # Enable encoder
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
|
|
|
@ -126,8 +126,8 @@ layer_state_t layer_state_set_user(layer_state_t state) {
|
|||
return state;
|
||||
}
|
||||
|
||||
//SSD1306 OLED update loop, make sure to enable OLED_DRIVER_ENABLE=yes in rules.mk
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
//SSD1306 OLED update loop, make sure to enable OLED_ENABLE=yes in rules.mk
|
||||
#ifdef OLED_ENABLE
|
||||
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
if (is_keyboard_master()) {
|
||||
|
@ -286,7 +286,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
#endif // OLED_DRIVER_ENABLE
|
||||
#endif // OLED_ENABLE
|
||||
|
||||
|
||||
// Rotary encoder related code
|
||||
|
|
|
@ -60,7 +60,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* | | | left | dn | rght | |-------. ,-------| | home | pgdn | end | | INS |
|
||||
* |------+------+------+------+------+------| | | |------+------+------+------+------+------|
|
||||
* | | | | | | |-------| |-------| | mute | prev | next | play |
|
||||
* | | | | | | |-------| |-------| | mute | prev | next | play |
|
||||
* `-----------------------------------------/ / \ \-----------------------------------------'
|
||||
* | | | | / / \ \ | | vol- | vol+ |
|
||||
* | | | |/ / \ \ | | | |
|
||||
|
@ -81,7 +81,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* | | | left | dn | rght | |-------. ,-------| | home | pgdn | end | | INS |
|
||||
* |------+------+------+------+------+------| | | |------+------+------+------+------+------|
|
||||
* | | | | | | |-------| |-------| | mute | prev | next | play |
|
||||
* | | | | | | |-------| |-------| | mute | prev | next | play |
|
||||
* `-----------------------------------------/ / \ \-----------------------------------------'
|
||||
* | | | | / / \ \ | | vol- | vol+ |
|
||||
* | | | |/ / \ \ | | | |
|
||||
|
@ -135,8 +135,8 @@ void matrix_init_user(void) {
|
|||
#endif
|
||||
}
|
||||
|
||||
//SSD1306 OLED update loop, make sure to enable OLED_DRIVER_ENABLE=yes in rules.mk
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
//SSD1306 OLED update loop, make sure to enable OLED_ENABLE=yes in rules.mk
|
||||
#ifdef OLED_ENABLE
|
||||
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
if (!is_keyboard_master())
|
||||
|
@ -169,11 +169,11 @@ void oled_task_user(void) {
|
|||
oled_write(read_logo(), false);
|
||||
}
|
||||
}
|
||||
#endif // OLED_DRIVER_ENABLE
|
||||
#endif // OLED_ENABLE
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (record->event.pressed) {
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
#ifdef OLED_ENABLE
|
||||
set_keylog(keycode, record);
|
||||
#endif
|
||||
// set_timelog();
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
#
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
|
||||
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
|
||||
SWAP_HANDS_ENABLE = no # Enable one-hand typing
|
||||
OLED_DRIVER_ENABLE= yes # OLED display
|
||||
OLED_ENABLE= yes # OLED display
|
||||
|
||||
# If you want to change the display of OLED, you need to change here
|
||||
SRC += ./lib/rgb_state_reader.c \
|
||||
|
|
|
@ -58,7 +58,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
)
|
||||
};
|
||||
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
#ifdef OLED_ENABLE
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
if (!is_keyboard_master()) return OLED_ROTATION_180;
|
||||
else return rotation;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
OLED_DRIVER_ENABLE = yes
|
||||
OLED_ENABLE = yes
|
||||
OLED_DRIVER = SSD1306
|
||||
WPM_ENABLE = yes
|
||||
EXTRAKEY_ENABLE = yes
|
||||
COMBO_ENABLE = yes
|
||||
|
|
|
@ -277,7 +277,7 @@ void matrix_init_user(void) {
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
#ifdef OLED_ENABLE
|
||||
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
if (!is_keyboard_master())
|
||||
|
@ -315,7 +315,7 @@ void oled_task_user(void) {
|
|||
}
|
||||
}
|
||||
|
||||
#endif //OLED_DRIVER_ENABLE
|
||||
#endif //OLED_ENABLE
|
||||
|
||||
#ifdef SWAP_HANDS_ENABLE
|
||||
__attribute__ ((weak))
|
||||
|
@ -337,7 +337,7 @@ const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
|
|||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (record->event.pressed) {
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
#ifdef OLED_ENABLE
|
||||
set_keylog(keycode, record);
|
||||
#endif
|
||||
// set_timelog();
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
OLED_DRIVER_ENABLE = yes
|
||||
OLED_ENABLE = yes
|
||||
OLED_DRIVER = SSD1306
|
||||
LTO_ENABLE = yes
|
||||
|
|
|
@ -120,7 +120,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
)
|
||||
};
|
||||
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
#ifdef OLED_ENABLE
|
||||
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
if (!is_keyboard_master())
|
||||
|
@ -215,12 +215,12 @@ void oled_task_user(void) {
|
|||
render_logo();
|
||||
}
|
||||
}
|
||||
#endif // OLED_DRIVER_ENABLE
|
||||
#endif // OLED_ENABLE
|
||||
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (record->event.pressed) {
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
#ifdef OLED_ENABLE
|
||||
set_keylog(keycode, record);
|
||||
#endif
|
||||
// set_timelog();
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
VIA_ENABLE = yes
|
||||
OLED_DRIVER_ENABLE = yes
|
||||
OLED_ENABLE = yes
|
||||
OLED_DRIVER = SSD1306
|
||||
MOUSEKEY_ENABLE = yes
|
||||
EXTRAKEY_ENABLE = yes
|
||||
|
|
|
@ -137,8 +137,8 @@ void matrix_init_user(void) {
|
|||
#endif
|
||||
}
|
||||
|
||||
//SSD1306 OLED update loop, make sure to enable OLED_DRIVER_ENABLE=yes in rules.mk
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
//SSD1306 OLED update loop, make sure to enable OLED_ENABLE=yes in rules.mk
|
||||
#ifdef OLED_ENABLE
|
||||
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
if (!is_keyboard_master())
|
||||
|
@ -171,11 +171,11 @@ void oled_task_user(void) {
|
|||
oled_write(read_logo(), false);
|
||||
}
|
||||
}
|
||||
#endif // OLED_DRIVER_ENABLE
|
||||
#endif // OLED_ENABLE
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (record->event.pressed) {
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
#ifdef OLED_ENABLE
|
||||
set_keylog(keycode, record);
|
||||
#endif
|
||||
// set_timelog();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
AUTO_SHIFT_ENABLE = yes
|
||||
OLED_DRIVER_ENABLE= yes # OLED display
|
||||
OLED_ENABLE= yes # OLED display
|
||||
|
||||
# If you want to change the display of OLED, you need to change here
|
||||
SRC += ./lib/rgb_state_reader.c \
|
||||
|
|
|
@ -119,8 +119,8 @@ void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) {
|
|||
}
|
||||
}
|
||||
|
||||
//SSD1306 OLED update loop, make sure to enable OLED_DRIVER_ENABLE=yes in rules.mk
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
//SSD1306 OLED update loop, make sure to enable OLED_ENABLE=yes in rules.mk
|
||||
#ifdef OLED_ENABLE
|
||||
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
if (!is_keyboard_master())
|
||||
|
@ -153,11 +153,11 @@ void oled_task_user(void) {
|
|||
oled_write(read_logo(), false);
|
||||
}
|
||||
}
|
||||
#endif // OLED_DRIVER_ENABLE
|
||||
#endif // OLED_ENABLE
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (record->event.pressed) {
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
#ifdef OLED_ENABLE
|
||||
set_keylog(keycode, record);
|
||||
#endif
|
||||
// set_timelog();
|
||||
|
|
|
@ -15,7 +15,7 @@ UNICODE_ENABLE = no # Unicode
|
|||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
SWAP_HANDS_ENABLE = no # Enable one-hand typing
|
||||
OLED_DRIVER_ENABLE= yes # OLED display
|
||||
OLED_ENABLE= yes # OLED display
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
|
|
@ -28,7 +28,8 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
|||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
OLED_DRIVER_ENABLE = yes # OLED display
|
||||
OLED_ENABLE = yes
|
||||
OLED_DRIVER = SSD1306 # OLED display
|
||||
SPLIT_KEYBOARD = yes
|
||||
|
||||
DEFAULT_FOLDER = lily58/rev1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue