aboutsummaryrefslogtreecommitdiff
path: root/keyboards/helix
diff options
context:
space:
mode:
authorXelus22 <17491233+Xelus22@users.noreply.github.com>2021-08-24 16:28:26 +1000
committerGitHub <noreply@github.com>2021-08-24 16:28:26 +1000
commit4e1c5887c5c08ebd2cf7868c8d9292aa728e7bf0 (patch)
tree24ff5bdf570a6a9f5a77a517005bffbb35e46b22 /keyboards/helix
parent6fd20acf4be76e7a2bd82d3dfd0a9bcca8c507eb (diff)
downloadqmk_firmware-4e1c5887c5c08ebd2cf7868c8d9292aa728e7bf0.tar.gz
qmk_firmware-4e1c5887c5c08ebd2cf7868c8d9292aa728e7bf0.zip
[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>
Diffstat (limited to 'keyboards/helix')
-rw-r--r--keyboards/helix/pico/local_features.mk3
-rw-r--r--keyboards/helix/rev2/config.h4
-rw-r--r--keyboards/helix/rev2/keymaps/default/oled_display.c4
-rw-r--r--keyboards/helix/rev2/keymaps/edvorakjp/oled.c4
-rw-r--r--keyboards/helix/rev2/keymaps/five_rows/oled_display.c4
-rw-r--r--keyboards/helix/rev2/keymaps/five_rows/rules.mk1
-rw-r--r--keyboards/helix/rev2/keymaps/xulkal/rules.mk3
-rw-r--r--keyboards/helix/rev2/local_features.mk10
-rw-r--r--keyboards/helix/rev3_4rows/oled_display.c2
-rw-r--r--keyboards/helix/rev3_4rows/rules.mk3
-rw-r--r--keyboards/helix/rev3_5rows/keymaps/five_rows/oled_display.c4
-rw-r--r--keyboards/helix/rev3_5rows/keymaps/five_rows/rules.mk4
-rw-r--r--keyboards/helix/rev3_5rows/oled_display.c2
-rw-r--r--keyboards/helix/rev3_5rows/rules.mk3
14 files changed, 29 insertions, 22 deletions
diff --git a/keyboards/helix/pico/local_features.mk b/keyboards/helix/pico/local_features.mk
index 25dcb8b6d..be5c739f9 100644
--- a/keyboards/helix/pico/local_features.mk
+++ b/keyboards/helix/pico/local_features.mk
@@ -138,7 +138,6 @@ ifneq ($(strip $(SHOW_HELIX_OPTIONS)),)
138 $(eval $(call HELIX_CUSTOMISE_MSG)) 138 $(eval $(call HELIX_CUSTOMISE_MSG))
139 ifneq ($(strip $(SHOW_VERBOSE_INFO)),) 139 ifneq ($(strip $(SHOW_VERBOSE_INFO)),)
140 $(info -- RGBLIGHT_ENABLE = $(RGBLIGHT_ENABLE)) 140 $(info -- RGBLIGHT_ENABLE = $(RGBLIGHT_ENABLE))
141 $(info -- OLED_DRIVER_ENABLE = $(OLED_DRIVER_ENABLE))
142 $(info -- CONSOLE_ENABLE = $(CONSOLE_ENABLE)) 141 $(info -- CONSOLE_ENABLE = $(CONSOLE_ENABLE))
143 $(info -- OPT_DEFS = $(OPT_DEFS)) 142 $(info -- OPT_DEFS = $(OPT_DEFS))
144 $(info -- SPLIT_KEYBOARD = $(SPLIT_KEYBOARD)) 143 $(info -- SPLIT_KEYBOARD = $(SPLIT_KEYBOARD))
@@ -146,3 +145,5 @@ ifneq ($(strip $(SHOW_HELIX_OPTIONS)),)
146 $(info ) 145 $(info )
147 endif 146 endif
148endif 147endif
148
149OLED_ENABLE = no # disable OLED in TOP/common_features.mk
diff --git a/keyboards/helix/rev2/config.h b/keyboards/helix/rev2/config.h
index 73f0c6199..041acee21 100644
--- a/keyboards/helix/rev2/config.h
+++ b/keyboards/helix/rev2/config.h
@@ -42,8 +42,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
42// #define EE_HANDS 42// #define EE_HANDS
43 43
44// Helix keyboard OLED support 44// Helix keyboard OLED support
45// see ./rules.mk: OLED_ENABLE=yes or no 45// see ./local_features.mk: OLED_SELECT=local
46#ifdef OLED_ENABLE 46#ifdef OLED_LOCAL_ENABLE
47 #define SSD1306OLED 47 #define SSD1306OLED
48#endif 48#endif
49 49
diff --git a/keyboards/helix/rev2/keymaps/default/oled_display.c b/keyboards/helix/rev2/keymaps/default/oled_display.c
index 04d6408c6..36a7cf0b1 100644
--- a/keyboards/helix/rev2/keymaps/default/oled_display.c
+++ b/keyboards/helix/rev2/keymaps/default/oled_display.c
@@ -36,9 +36,9 @@ enum layer_number {
36}; 36};
37 37
38//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h 38//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h
39#if defined(SSD1306OLED) || defined(OLED_DRIVER_ENABLE) 39#if defined(SSD1306OLED) || defined(OLED_ENABLE)
40 40
41# if defined(OLED_DRIVER_ENABLE) 41# if defined(OLED_ENABLE)
42oled_rotation_t oled_init_user(oled_rotation_t rotation) { 42oled_rotation_t oled_init_user(oled_rotation_t rotation) {
43 if (is_keyboard_master()) { 43 if (is_keyboard_master()) {
44 return OLED_ROTATION_0; 44 return OLED_ROTATION_0;
diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/oled.c b/keyboards/helix/rev2/keymaps/edvorakjp/oled.c
index 4bbab1dc4..500a7bbf1 100644
--- a/keyboards/helix/rev2/keymaps/edvorakjp/oled.c
+++ b/keyboards/helix/rev2/keymaps/edvorakjp/oled.c
@@ -2,7 +2,7 @@
2#include <string.h> 2#include <string.h>
3#include "oled.h" 3#include "oled.h"
4 4
5#ifdef OLED_DRIVER_ENABLE 5#ifdef OLED_ENABLE
6void render_host_led_state(void) { 6void render_host_led_state(void) {
7 char led_state_str[24]; 7 char led_state_str[24];
8 uint8_t leds = host_keyboard_leds(); 8 uint8_t leds = host_keyboard_leds();
@@ -65,4 +65,4 @@ void oled_task_user(void) {
65 render_logo(); 65 render_logo();
66 } 66 }
67} 67}
68#endif // OLED_DRIVER_ENABLE 68#endif // OLED_ENABLE
diff --git a/keyboards/helix/rev2/keymaps/five_rows/oled_display.c b/keyboards/helix/rev2/keymaps/five_rows/oled_display.c
index 689efe4c8..090e8aaec 100644
--- a/keyboards/helix/rev2/keymaps/five_rows/oled_display.c
+++ b/keyboards/helix/rev2/keymaps/five_rows/oled_display.c
@@ -35,9 +35,9 @@ void init_helix_oled(void) {
35} 35}
36 36
37//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h 37//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h
38#if defined(SSD1306OLED) || defined(OLED_DRIVER_ENABLE) 38#if defined(SSD1306OLED) || defined(OLED_ENABLE)
39 39
40# if defined(OLED_DRIVER_ENABLE) 40# if defined(OLED_ENABLE)
41oled_rotation_t oled_init_user(oled_rotation_t rotation) { 41oled_rotation_t oled_init_user(oled_rotation_t rotation) {
42 if (is_keyboard_master()) { 42 if (is_keyboard_master()) {
43 return OLED_ROTATION_0; 43 return OLED_ROTATION_0;
diff --git a/keyboards/helix/rev2/keymaps/five_rows/rules.mk b/keyboards/helix/rev2/keymaps/five_rows/rules.mk
index 58b7ef4ef..e59ce7332 100644
--- a/keyboards/helix/rev2/keymaps/five_rows/rules.mk
+++ b/keyboards/helix/rev2/keymaps/five_rows/rules.mk
@@ -31,7 +31,6 @@ ifneq ($(strip $(HELIX)),)
31 $(if $(SHOW_PARCE),$(info parse -$1-)) #debug 31 $(if $(SHOW_PARCE),$(info parse -$1-)) #debug
32 ifeq ($(strip $1),dispoff) 32 ifeq ($(strip $1),dispoff)
33 OLED_ENABLE = no 33 OLED_ENABLE = no
34 OLED_DRIVER_ENABLE = no
35 LED_BACK_ENABLE = no 34 LED_BACK_ENABLE = no
36 LED_UNDERGLOW_ENABLE = no 35 LED_UNDERGLOW_ENABLE = no
37 endif 36 endif
diff --git a/keyboards/helix/rev2/keymaps/xulkal/rules.mk b/keyboards/helix/rev2/keymaps/xulkal/rules.mk
index 7fac4df7e..bdf0479a4 100644
--- a/keyboards/helix/rev2/keymaps/xulkal/rules.mk
+++ b/keyboards/helix/rev2/keymaps/xulkal/rules.mk
@@ -4,7 +4,8 @@ OPT_DEFS += -DRGBLIGHT_ANIMATIONS
4# Helix specific define for correct RGBLED_NUM 4# Helix specific define for correct RGBLED_NUM
5OPT_DEFS += -DRGBLED_BACK 5OPT_DEFS += -DRGBLED_BACK
6 6
7OLED_DRIVER_ENABLE = yes 7OLED_ENABLE = yes
8OLED_DRIVER = SSD1306
8# Helix specific font file 9# Helix specific font file
9OPT_DEFS += -DOLED_FONT_H=\"common/glcdfont.c\" 10OPT_DEFS += -DOLED_FONT_H=\"common/glcdfont.c\"
10# Xulkal specific oled define 11# Xulkal specific oled define
diff --git a/keyboards/helix/rev2/local_features.mk b/keyboards/helix/rev2/local_features.mk
index ce3853a02..47e8c6a83 100644
--- a/keyboards/helix/rev2/local_features.mk
+++ b/keyboards/helix/rev2/local_features.mk
@@ -156,17 +156,20 @@ endif
156 156
157ifeq ($(strip $(OLED_ENABLE)), yes) 157ifeq ($(strip $(OLED_ENABLE)), yes)
158 ifeq ($(strip $(OLED_SELECT)),core) 158 ifeq ($(strip $(OLED_SELECT)),core)
159 OLED_DRIVER_ENABLE = yes 159 OLED_ENABLE = yes
160 OLED_DRIVER = SSD1306
160 ifeq ($(strip $(LOCAL_GLCDFONT)), yes) 161 ifeq ($(strip $(LOCAL_GLCDFONT)), yes)
161 OPT_DEFS += -DOLED_FONT_H=\<helixfont.h\> 162 OPT_DEFS += -DOLED_FONT_H=\<helixfont.h\>
162 else 163 else
163 OPT_DEFS += -DOLED_FONT_H=\"common/glcdfont.c\" 164 OPT_DEFS += -DOLED_FONT_H=\"common/glcdfont.c\"
164 endif 165 endif
165 else 166 else
167 OLED_ENABLE = no # disable OLED in TOP/common_features.mk
168 OLED_LOCAL_ENABLE = yes
166 SRC += local_drivers/i2c.c 169 SRC += local_drivers/i2c.c
167 SRC += local_drivers/ssd1306.c 170 SRC += local_drivers/ssd1306.c
168 KEYBOARD_PATHS += $(HELIX_TOP_DIR)/local_drivers 171 KEYBOARD_PATHS += $(HELIX_TOP_DIR)/local_drivers
169 OPT_DEFS += -DOLED_ENABLE 172 OPT_DEFS += -DOLED_LOCAL_ENABLE
170 ifeq ($(strip $(LOCAL_GLCDFONT)), yes) 173 ifeq ($(strip $(LOCAL_GLCDFONT)), yes)
171 OPT_DEFS += -DLOCAL_GLCDFONT 174 OPT_DEFS += -DLOCAL_GLCDFONT
172 endif 175 endif
@@ -177,7 +180,8 @@ ifneq ($(strip $(SHOW_HELIX_OPTIONS)),)
177 $(eval $(call HELIX_CUSTOMISE_MSG)) 180 $(eval $(call HELIX_CUSTOMISE_MSG))
178 ifneq ($(strip $(SHOW_VERBOSE_INFO)),) 181 ifneq ($(strip $(SHOW_VERBOSE_INFO)),)
179 $(info -- RGBLIGHT_ENABLE = $(RGBLIGHT_ENABLE)) 182 $(info -- RGBLIGHT_ENABLE = $(RGBLIGHT_ENABLE))
180 $(info -- OLED_DRIVER_ENABLE = $(OLED_DRIVER_ENABLE)) 183 $(info -- OLED_DRIVER = $(OLED_DRIVER))
184 $(info -- OLED_LOCAL_ENABLE = $(OLED_LOCAL_ENABLE))
181 $(info -- CONSOLE_ENABLE = $(CONSOLE_ENABLE)) 185 $(info -- CONSOLE_ENABLE = $(CONSOLE_ENABLE))
182 $(info -- OPT_DEFS = $(OPT_DEFS)) 186 $(info -- OPT_DEFS = $(OPT_DEFS))
183 $(info -- SPLIT_KEYBOARD = $(SPLIT_KEYBOARD)) 187 $(info -- SPLIT_KEYBOARD = $(SPLIT_KEYBOARD))
diff --git a/keyboards/helix/rev3_4rows/oled_display.c b/keyboards/helix/rev3_4rows/oled_display.c
index 7716a172c..23edbf7be 100644
--- a/keyboards/helix/rev3_4rows/oled_display.c
+++ b/keyboards/helix/rev3_4rows/oled_display.c
@@ -35,7 +35,7 @@ enum layer_names {
35 _ADJUST 35 _ADJUST
36}; 36};
37 37
38#ifdef OLED_DRIVER_ENABLE 38#ifdef OLED_ENABLE
39 39
40void render_status(void) { 40void render_status(void) {
41 41
diff --git a/keyboards/helix/rev3_4rows/rules.mk b/keyboards/helix/rev3_4rows/rules.mk
index 530d1d750..f29deaf58 100644
--- a/keyboards/helix/rev3_4rows/rules.mk
+++ b/keyboards/helix/rev3_4rows/rules.mk
@@ -3,7 +3,8 @@ RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
3SPLIT_KEYBOARD = yes 3SPLIT_KEYBOARD = yes
4RGB_MATRIX_ENABLE = no 4RGB_MATRIX_ENABLE = no
5RGB_MATRIX_DRIVER = WS2812 5RGB_MATRIX_DRIVER = WS2812
6OLED_DRIVER_ENABLE = yes 6OLED_ENABLE = yes
7OLED_DRIVER = SSD1306
7ENCODER_ENABLE = yes 8ENCODER_ENABLE = yes
8DIP_SWITCH_ENABLE = no 9DIP_SWITCH_ENABLE = no
9LTO_ENABLE = yes 10LTO_ENABLE = yes
diff --git a/keyboards/helix/rev3_5rows/keymaps/five_rows/oled_display.c b/keyboards/helix/rev3_5rows/keymaps/five_rows/oled_display.c
index 689efe4c8..090e8aaec 100644
--- a/keyboards/helix/rev3_5rows/keymaps/five_rows/oled_display.c
+++ b/keyboards/helix/rev3_5rows/keymaps/five_rows/oled_display.c
@@ -35,9 +35,9 @@ void init_helix_oled(void) {
35} 35}
36 36
37//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h 37//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h
38#if defined(SSD1306OLED) || defined(OLED_DRIVER_ENABLE) 38#if defined(SSD1306OLED) || defined(OLED_ENABLE)
39 39
40# if defined(OLED_DRIVER_ENABLE) 40# if defined(OLED_ENABLE)
41oled_rotation_t oled_init_user(oled_rotation_t rotation) { 41oled_rotation_t oled_init_user(oled_rotation_t rotation) {
42 if (is_keyboard_master()) { 42 if (is_keyboard_master()) {
43 return OLED_ROTATION_0; 43 return OLED_ROTATION_0;
diff --git a/keyboards/helix/rev3_5rows/keymaps/five_rows/rules.mk b/keyboards/helix/rev3_5rows/keymaps/five_rows/rules.mk
index 734479764..d10972bbd 100644
--- a/keyboards/helix/rev3_5rows/keymaps/five_rows/rules.mk
+++ b/keyboards/helix/rev3_5rows/keymaps/five_rows/rules.mk
@@ -19,7 +19,7 @@ ifneq ($(strip $(HELIX)),)
19 # parse 'dispoff', 'consle', 'back', 'oled', 'no-ani', 'mini-ani', 'lto', 'no-lto', 'no-enc', 'scan' 19 # parse 'dispoff', 'consle', 'back', 'oled', 'no-ani', 'mini-ani', 'lto', 'no-lto', 'no-enc', 'scan'
20 $(if $(SHOW_PARCE),$(info parse .$1.)) #debug 20 $(if $(SHOW_PARCE),$(info parse .$1.)) #debug
21 ifeq ($(strip $1),dispoff) 21 ifeq ($(strip $1),dispoff)
22 OLED_DRIVER_ENABLE = no 22 OLED_ENABLE = no
23 RGBLIGHT_ENABLE = no 23 RGBLIGHT_ENABLE = no
24 endif 24 endif
25 ifeq ($(strip $1),console) 25 ifeq ($(strip $1),console)
@@ -38,7 +38,7 @@ ifneq ($(strip $(HELIX)),)
38 ENCODER_ENABLE = no 38 ENCODER_ENABLE = no
39 endif 39 endif
40 ifeq ($(strip $1),oled) 40 ifeq ($(strip $1),oled)
41 OLED_DRIVER_ENABLE = yes 41 OLED_ENABLE = yes
42 endif 42 endif
43 ifeq ($(strip $1),back) 43 ifeq ($(strip $1),back)
44 RGBLIGHT_ENABLE = yes 44 RGBLIGHT_ENABLE = yes
diff --git a/keyboards/helix/rev3_5rows/oled_display.c b/keyboards/helix/rev3_5rows/oled_display.c
index ffe8b594b..fbaa9bc56 100644
--- a/keyboards/helix/rev3_5rows/oled_display.c
+++ b/keyboards/helix/rev3_5rows/oled_display.c
@@ -35,7 +35,7 @@ enum layer_names {
35 _ADJUST 35 _ADJUST
36}; 36};
37 37
38#ifdef OLED_DRIVER_ENABLE 38#ifdef OLED_ENABLE
39 39
40void render_status(void) { 40void render_status(void) {
41 41
diff --git a/keyboards/helix/rev3_5rows/rules.mk b/keyboards/helix/rev3_5rows/rules.mk
index 530d1d750..f29deaf58 100644
--- a/keyboards/helix/rev3_5rows/rules.mk
+++ b/keyboards/helix/rev3_5rows/rules.mk
@@ -3,7 +3,8 @@ RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
3SPLIT_KEYBOARD = yes 3SPLIT_KEYBOARD = yes
4RGB_MATRIX_ENABLE = no 4RGB_MATRIX_ENABLE = no
5RGB_MATRIX_DRIVER = WS2812 5RGB_MATRIX_DRIVER = WS2812
6OLED_DRIVER_ENABLE = yes 6OLED_ENABLE = yes
7OLED_DRIVER = SSD1306
7ENCODER_ENABLE = yes 8ENCODER_ENABLE = yes
8DIP_SWITCH_ENABLE = no 9DIP_SWITCH_ENABLE = no
9LTO_ENABLE = yes 10LTO_ENABLE = yes