From 4e1c5887c5c08ebd2cf7868c8d9292aa728e7bf0 Mon Sep 17 00:00:00 2001 From: Xelus22 <17491233+Xelus22@users.noreply.github.com> Date: Tue, 24 Aug 2021 16:28:26 +1000 Subject: [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 Co-authored-by: mtei <2170248+mtei@users.noreply.github.com> --- keyboards/rgbkb/mun/rules.mk | 5 +++-- keyboards/rgbkb/pan/keymaps/default/keymap.c | 2 +- keyboards/rgbkb/pan/rules.mk | 3 ++- keyboards/rgbkb/sol/keymaps/brianweyer/keymap.c | 2 +- keyboards/rgbkb/sol/keymaps/brianweyer/rules.mk | 2 +- keyboards/rgbkb/sol/keymaps/danielhklein/keymap.c | 2 +- keyboards/rgbkb/sol/keymaps/default/keymap.c | 2 +- keyboards/rgbkb/sol/keymaps/default/readme.md | 2 +- keyboards/rgbkb/sol/keymaps/xulkal/rules.mk | 2 +- keyboards/rgbkb/sol/keymaps/xyverz/keymap.c | 2 +- keyboards/rgbkb/sol/keymaps/xyverz/rules.mk | 5 +++-- keyboards/rgbkb/sol/rev1/rules.mk | 2 +- keyboards/rgbkb/sol/rev2/config.h | 2 +- keyboards/rgbkb/sol/rev2/post_rules.mk | 2 +- keyboards/rgbkb/sol/rev2/rules.mk | 4 ++-- keyboards/rgbkb/zen/rev2/keymaps/default/keymap.c | 2 +- keyboards/rgbkb/zen/rev2/rev2.c | 2 +- keyboards/rgbkb/zen/rev2/rules.mk | 4 ++-- keyboards/rgbkb/zygomorph/keymaps/5x6pad/rules.mk | 2 +- keyboards/rgbkb/zygomorph/keymaps/default/readme.md | 3 ++- keyboards/rgbkb/zygomorph/keymaps/default/rules.mk | 2 +- keyboards/rgbkb/zygomorph/keymaps/default_oled/keymap.c | 2 +- keyboards/rgbkb/zygomorph/keymaps/default_oled/rules.mk | 3 ++- keyboards/rgbkb/zygomorph/keymaps/kageurufu/rules.mk | 2 +- keyboards/rgbkb/zygomorph/keymaps/xulkal/rules.mk | 2 +- 25 files changed, 34 insertions(+), 29 deletions(-) (limited to 'keyboards/rgbkb') diff --git a/keyboards/rgbkb/mun/rules.mk b/keyboards/rgbkb/mun/rules.mk index bea2f354cc..ce8029968b 100644 --- a/keyboards/rgbkb/mun/rules.mk +++ b/keyboards/rgbkb/mun/rules.mk @@ -27,7 +27,8 @@ RGB_MATRIX_ENABLE = yes RGB_MATRIX_DRIVER = WS2812 SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -OLED_DRIVER_ENABLE = yes # Enable the OLED Driver +OLED_ENABLE = yes +OLED_DRIVER = SSD1306 # Enable the OLED Driver ENCODER_ENABLE = yes @@ -42,4 +43,4 @@ OPT_DEFS += -Ikeyboards/rgbkb/common # matrix optimisations SRC += matrix.c -DEFAULT_FOLDER = rgbkb/mun/rev1 \ No newline at end of file +DEFAULT_FOLDER = rgbkb/mun/rev1 diff --git a/keyboards/rgbkb/pan/keymaps/default/keymap.c b/keyboards/rgbkb/pan/keymaps/default/keymap.c index f19d36256c..dac385aa4c 100644 --- a/keyboards/rgbkb/pan/keymaps/default/keymap.c +++ b/keyboards/rgbkb/pan/keymaps/default/keymap.c @@ -70,7 +70,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -#ifdef OLED_DRIVER_ENABLE +#ifdef OLED_ENABLE void oled_task_user(void) { // Host Keyboard Layer Status oled_write_P(PSTR("RGBKB Pan\n"), false); diff --git a/keyboards/rgbkb/pan/rules.mk b/keyboards/rgbkb/pan/rules.mk index 01a98fc5e4..301b17d7f7 100644 --- a/keyboards/rgbkb/pan/rules.mk +++ b/keyboards/rgbkb/pan/rules.mk @@ -16,7 +16,8 @@ RGB_MATRIX_ENABLE = yes RGB_MATRIX_DRIVER = WS2812 WS2812_DRIVER = bitbang ENCODER_ENABLE = yes -OLED_DRIVER_ENABLE = yes +OLED_ENABLE = yes +OLED_DRIVER = SSD1306 # RGB layout selection RGB_ENCODERS = yes # For RGB encoders, solder on both WS2811 chips diff --git a/keyboards/rgbkb/sol/keymaps/brianweyer/keymap.c b/keyboards/rgbkb/sol/keymaps/brianweyer/keymap.c index 2ae07984d8..aa465a6962 100644 --- a/keyboards/rgbkb/sol/keymaps/brianweyer/keymap.c +++ b/keyboards/rgbkb/sol/keymaps/brianweyer/keymap.c @@ -196,7 +196,7 @@ void matrix_init_user(void) { // OLED Driver Logic -#ifdef OLED_DRIVER_ENABLE +#ifdef OLED_ENABLE oled_rotation_t oled_init_user(oled_rotation_t rotation) { if (!is_keyboard_master()) diff --git a/keyboards/rgbkb/sol/keymaps/brianweyer/rules.mk b/keyboards/rgbkb/sol/keymaps/brianweyer/rules.mk index 47dd9a7e27..f9832323b4 100644 --- a/keyboards/rgbkb/sol/keymaps/brianweyer/rules.mk +++ b/keyboards/rgbkb/sol/keymaps/brianweyer/rules.mk @@ -4,7 +4,7 @@ LED_MIRRORED = no # Mirror LEDs across halves (enable DIP 1 on slave, and DIP 2 and 3 on master) # Misc -OLED_DRIVER_ENABLE = yes # Enable the OLED Driver +OLED_ENABLE = yes # Enable the OLED Driver diff --git a/keyboards/rgbkb/sol/keymaps/danielhklein/keymap.c b/keyboards/rgbkb/sol/keymaps/danielhklein/keymap.c index 96e19bf865..2ef78f122d 100644 --- a/keyboards/rgbkb/sol/keymaps/danielhklein/keymap.c +++ b/keyboards/rgbkb/sol/keymaps/danielhklein/keymap.c @@ -261,7 +261,7 @@ void matrix_init_user(void) { // OLED Driver Logic -#ifdef OLED_DRIVER_ENABLE +#ifdef OLED_ENABLE oled_rotation_t oled_init_user(oled_rotation_t rotation) { if (!has_usb()) diff --git a/keyboards/rgbkb/sol/keymaps/default/keymap.c b/keyboards/rgbkb/sol/keymaps/default/keymap.c index 0883cb7753..6fc2cb7776 100644 --- a/keyboards/rgbkb/sol/keymaps/default/keymap.c +++ b/keyboards/rgbkb/sol/keymaps/default/keymap.c @@ -298,7 +298,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } // OLED Driver Logic -#ifdef OLED_DRIVER_ENABLE +#ifdef OLED_ENABLE oled_rotation_t oled_init_user(oled_rotation_t rotation) { if (is_keyboard_master()) return OLED_ROTATION_270; diff --git a/keyboards/rgbkb/sol/keymaps/default/readme.md b/keyboards/rgbkb/sol/keymaps/default/readme.md index ce5bce19ee..3f3e1afc5a 100644 --- a/keyboards/rgbkb/sol/keymaps/default/readme.md +++ b/keyboards/rgbkb/sol/keymaps/default/readme.md @@ -92,7 +92,7 @@ RGBLIGHT_FULL_POWER = no # Allow maximum RGB brightness. Otherwise, limited t UNICODE_ENABLE = no # Unicode SWAP_HANDS_ENABLE = no # Enable one-hand typing -OLED_DRIVER_ENABLE = no # Enable the OLED Driver (+5000) +OLED_ENABLE = no # Enable the OLED Driver (+5000) IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) diff --git a/keyboards/rgbkb/sol/keymaps/xulkal/rules.mk b/keyboards/rgbkb/sol/keymaps/xulkal/rules.mk index c386b39d35..4da351f251 100644 --- a/keyboards/rgbkb/sol/keymaps/xulkal/rules.mk +++ b/keyboards/rgbkb/sol/keymaps/xulkal/rules.mk @@ -9,7 +9,7 @@ FULLHAND_ENABLE = no # Enables the additional 24 Full Hand LEDs SF_ENABLE = no # Enables the additional 38 Starfighter LEDs # Misc -OLED_DRIVER_ENABLE = yes # Enable the OLED Driver +OLED_ENABLE = yes # Enable the OLED Driver # Not using the encoder for rev1 ifeq ($(strip $(KEYBOARD)), rgbkb/sol/rev1) diff --git a/keyboards/rgbkb/sol/keymaps/xyverz/keymap.c b/keyboards/rgbkb/sol/keymaps/xyverz/keymap.c index ed98a951c2..73f7220a63 100644 --- a/keyboards/rgbkb/sol/keymaps/xyverz/keymap.c +++ b/keyboards/rgbkb/sol/keymaps/xyverz/keymap.c @@ -279,7 +279,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { #endif // OLED Driver Logic -#ifdef OLED_DRIVER_ENABLE +#ifdef OLED_ENABLE oled_rotation_t oled_init_user(oled_rotation_t rotation) { if (is_keyboard_master()) return OLED_ROTATION_270; diff --git a/keyboards/rgbkb/sol/keymaps/xyverz/rules.mk b/keyboards/rgbkb/sol/keymaps/xyverz/rules.mk index 5d94aa9df7..bb9d58e942 100644 --- a/keyboards/rgbkb/sol/keymaps/xyverz/rules.mk +++ b/keyboards/rgbkb/sol/keymaps/xyverz/rules.mk @@ -24,7 +24,8 @@ OLED_ENABLE = no # OLED_ENABLE IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) DEFAULT_FOLDER = rgbkb/sol/rev1 ENCODER_ENABLE = no -OLED_DRIVER_ENABLE = yes +OLED_ENABLE = yes +OLED_DRIVER = SSD1306 # Do not edit past here @@ -51,4 +52,4 @@ endif ifeq ($(strip $(LED_MIRRORED)), yes) OPT_DEFS += -DLED_MIRRORED -endif \ No newline at end of file +endif diff --git a/keyboards/rgbkb/sol/rev1/rules.mk b/keyboards/rgbkb/sol/rev1/rules.mk index 9124e3d0e9..5c5850f907 100644 --- a/keyboards/rgbkb/sol/rev1/rules.mk +++ b/keyboards/rgbkb/sol/rev1/rules.mk @@ -25,5 +25,5 @@ RGBLIGHT_FULL_POWER = no # Allow maximum RGB brightness for RGBLIGHT IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) # Misc -OLED_DRIVER_ENABLE = no # Enable the OLED Driver +OLED_ENABLE = no # Enable the OLED Driver SWAP_HANDS_ENABLE = no # Enable one-hand typing diff --git a/keyboards/rgbkb/sol/rev2/config.h b/keyboards/rgbkb/sol/rev2/config.h index 4ffcecc6bb..f0c71db34e 100644 --- a/keyboards/rgbkb/sol/rev2/config.h +++ b/keyboards/rgbkb/sol/rev2/config.h @@ -64,7 +64,7 @@ along with this program. If not, see . #define ENCODERS_PAD_A { D2 } #define ENCODERS_PAD_B { D6 } #else -#ifdef OLED_DRIVER_ENABLE +#ifdef OLED_ENABLE #error Extra encoders cannot be enabled at the same time as the OLED Driver as they use the same pins. #endif #define ENCODERS_PAD_A { D2, D1, B0 } diff --git a/keyboards/rgbkb/sol/rev2/post_rules.mk b/keyboards/rgbkb/sol/rev2/post_rules.mk index ab03325c9f..feaa2ac1f2 100644 --- a/keyboards/rgbkb/sol/rev2/post_rules.mk +++ b/keyboards/rgbkb/sol/rev2/post_rules.mk @@ -28,7 +28,7 @@ ifeq ($(strip $(EXTRA_ENCODERS_ENABLE)), yes) OPT_DEFS += -DEXTRA_ENCODERS_ENABLE endif -ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes) +ifeq ($(strip $(OLED_ENABLE)), yes) ifeq ($(strip $(ENCODER_ENABLE)), yes) ifneq ($(strip $(RGB_MATRIX_ENABLE)), no) ifneq ($(strip $(RGB_OLED_MENU)), no) diff --git a/keyboards/rgbkb/sol/rev2/rules.mk b/keyboards/rgbkb/sol/rev2/rules.mk index 8871a8a7c4..e5d2a9dcc2 100644 --- a/keyboards/rgbkb/sol/rev2/rules.mk +++ b/keyboards/rgbkb/sol/rev2/rules.mk @@ -27,8 +27,8 @@ SF_ENABLE = no # Enables the additional 38 Starfighter LEDs IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) # Misc -OLED_DRIVER_ENABLE = no # Enable the OLED Driver -EXTRA_ENCODERS_ENABLE = no # Enables 3 encoders per side (up from 1, not compatible with OLED_DRIVER_ENABLE) +OLED_ENABLE = no # Enable the OLED Driver +EXTRA_ENCODERS_ENABLE = no # Enables 3 encoders per side (up from 1, not compatible with OLED_ENABLE) SWAP_HANDS_ENABLE = no # Enable one-hand typing LTO_ENABLE = yes # Enable Link Time Optimizations greatly reducing firmware size by disabling the old Macros and Functions features diff --git a/keyboards/rgbkb/zen/rev2/keymaps/default/keymap.c b/keyboards/rgbkb/zen/rev2/keymaps/default/keymap.c index f31da8bf5d..5bc5e00d8d 100644 --- a/keyboards/rgbkb/zen/rev2/keymaps/default/keymap.c +++ b/keyboards/rgbkb/zen/rev2/keymaps/default/keymap.c @@ -103,7 +103,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } -#if OLED_DRIVER_ENABLE +#if OLED_ENABLE const char* layer_name_user(uint32_t layer) { switch (layer) { case _QWERTY: diff --git a/keyboards/rgbkb/zen/rev2/rev2.c b/keyboards/rgbkb/zen/rev2/rev2.c index 28a5a9f203..7bc0072467 100644 --- a/keyboards/rgbkb/zen/rev2/rev2.c +++ b/keyboards/rgbkb/zen/rev2/rev2.c @@ -1,6 +1,6 @@ #include "rev2.h" -#ifdef OLED_DRIVER_ENABLE +#ifdef OLED_ENABLE #include "split_util.h" #include "oled_driver.h" diff --git a/keyboards/rgbkb/zen/rev2/rules.mk b/keyboards/rgbkb/zen/rev2/rules.mk index e9d19a69aa..9bb8b8cd0d 100644 --- a/keyboards/rgbkb/zen/rev2/rules.mk +++ b/keyboards/rgbkb/zen/rev2/rules.mk @@ -1,9 +1,9 @@ ENCODER_ENABLE = yes -OLED_DRIVER_ENABLE = no +OLED_ENABLE = no # Setup so that OLED can be turned on/off easily -ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes) +ifeq ($(strip $(OLED_ENABLE)), yes) # Custom local font file OPT_DEFS += -DOLED_FONT_H=\"common/glcdfont.c\" endif diff --git a/keyboards/rgbkb/zygomorph/keymaps/5x6pad/rules.mk b/keyboards/rgbkb/zygomorph/keymaps/5x6pad/rules.mk index c223cb9ebb..ccceffe6a5 100644 --- a/keyboards/rgbkb/zygomorph/keymaps/5x6pad/rules.mk +++ b/keyboards/rgbkb/zygomorph/keymaps/5x6pad/rules.mk @@ -17,7 +17,7 @@ RGBLIGHT_FULL_POWER = yes # Allow maximum RGB brightness. Otherwise, limited t UNICODE_ENABLE = no # Unicode SWAP_HANDS_ENABLE = no # Enable one-hand typing ENCODER_ENABLE = yes # Enable rotary encoder -OLED_DRIVER_ENABLE = no # Enable the OLED Driver +OLED_ENABLE = no # Enable the OLED Driver IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) LTO_ENABLE = no # Enable optimizations to reduce firmware size. Also disables action macros and functions. diff --git a/keyboards/rgbkb/zygomorph/keymaps/default/readme.md b/keyboards/rgbkb/zygomorph/keymaps/default/readme.md index e1d30b36b6..4f7b645109 100644 --- a/keyboards/rgbkb/zygomorph/keymaps/default/readme.md +++ b/keyboards/rgbkb/zygomorph/keymaps/default/readme.md @@ -98,7 +98,8 @@ RGBLIGHT_FULL_POWER = yes # Allow maximum RGB brightness. Otherwise, limited t UNICODE_ENABLE = no # Unicode SWAP_HANDS_ENABLE = no # Enable one-hand typing ENCODER_ENABLE = yes # Enable rotary encoder (+90) -OLED_DRIVER_ENABLE = yes # Enable the OLED Driver (+5000) +OLED_ENABLE = yes +OLED_DRIVER = SSD1306 # Enable the OLED Driver (+5000) IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) diff --git a/keyboards/rgbkb/zygomorph/keymaps/default/rules.mk b/keyboards/rgbkb/zygomorph/keymaps/default/rules.mk index c223cb9ebb..ccceffe6a5 100644 --- a/keyboards/rgbkb/zygomorph/keymaps/default/rules.mk +++ b/keyboards/rgbkb/zygomorph/keymaps/default/rules.mk @@ -17,7 +17,7 @@ RGBLIGHT_FULL_POWER = yes # Allow maximum RGB brightness. Otherwise, limited t UNICODE_ENABLE = no # Unicode SWAP_HANDS_ENABLE = no # Enable one-hand typing ENCODER_ENABLE = yes # Enable rotary encoder -OLED_DRIVER_ENABLE = no # Enable the OLED Driver +OLED_ENABLE = no # Enable the OLED Driver IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) LTO_ENABLE = no # Enable optimizations to reduce firmware size. Also disables action macros and functions. diff --git a/keyboards/rgbkb/zygomorph/keymaps/default_oled/keymap.c b/keyboards/rgbkb/zygomorph/keymaps/default_oled/keymap.c index 972fa4b057..ffc222324d 100644 --- a/keyboards/rgbkb/zygomorph/keymaps/default_oled/keymap.c +++ b/keyboards/rgbkb/zygomorph/keymaps/default_oled/keymap.c @@ -169,7 +169,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { // SSD1306 OLED driver logic -#ifdef OLED_DRIVER_ENABLE +#ifdef OLED_ENABLE static void render_logo(void) { static const char PROGMEM rgbkb_logo[] = { diff --git a/keyboards/rgbkb/zygomorph/keymaps/default_oled/rules.mk b/keyboards/rgbkb/zygomorph/keymaps/default_oled/rules.mk index f2c194f0d3..ce80fc0d5a 100644 --- a/keyboards/rgbkb/zygomorph/keymaps/default_oled/rules.mk +++ b/keyboards/rgbkb/zygomorph/keymaps/default_oled/rules.mk @@ -17,7 +17,8 @@ RGBLIGHT_FULL_POWER = yes # Allow maximum RGB brightness. Otherwise, limited t UNICODE_ENABLE = no # Unicode SWAP_HANDS_ENABLE = no # Enable one-hand typing ENCODER_ENABLE = yes # Enable rotary encoder -OLED_DRIVER_ENABLE = yes # Enable the OLED Driver +OLED_ENABLE = yes +OLED_DRIVER = SSD1306 # Enable the OLED Driver IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) LTO_ENABLE = yes # Enable optimizations to reduce firmware size. Also disables action macros and functions. diff --git a/keyboards/rgbkb/zygomorph/keymaps/kageurufu/rules.mk b/keyboards/rgbkb/zygomorph/keymaps/kageurufu/rules.mk index 61c7a07d6e..d484c47366 100644 --- a/keyboards/rgbkb/zygomorph/keymaps/kageurufu/rules.mk +++ b/keyboards/rgbkb/zygomorph/keymaps/kageurufu/rules.mk @@ -17,7 +17,7 @@ RGBLIGHT_FULL_POWER = yes # Allow maximum RGB brightness. Otherwise, limited t UNICODE_ENABLE = no # Unicode SWAP_HANDS_ENABLE = no # Enable one-hand typing ENCODER_ENABLE = yes # Enable rotary encoder -OLED_DRIVER_ENABLE = no # Enable the OLED Driver +OLED_ENABLE = no # Enable the OLED Driver IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) # Do not edit past here diff --git a/keyboards/rgbkb/zygomorph/keymaps/xulkal/rules.mk b/keyboards/rgbkb/zygomorph/keymaps/xulkal/rules.mk index d7d50e1378..0041d60426 100644 --- a/keyboards/rgbkb/zygomorph/keymaps/xulkal/rules.mk +++ b/keyboards/rgbkb/zygomorph/keymaps/xulkal/rules.mk @@ -19,7 +19,7 @@ RGBLIGHT_FULL_POWER = yes # Allow maximum RGB brightness. Otherwise, limited t UNICODE_ENABLE = no # Unicode SWAP_HANDS_ENABLE = no # Enable one-hand typing ENCODER_ENABLE = no # Enable rotary encoder -OLED_DRIVER_ENABLE = no # Enable the OLED Driver +OLED_ENABLE = no # Enable the OLED Driver IOS_DEVICE_ENABLE = no # Limit max brightness to connect to IOS device (iPad,iPhone) LTO_ENABLE = no # Enable optimizations to reduce firmware size. Also disables action macros and functions. -- cgit v1.2.3