diff options
author | Xelus22 <17491233+Xelus22@users.noreply.github.com> | 2021-08-24 16:28:26 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-24 16:28:26 +1000 |
commit | 4e1c5887c5c08ebd2cf7868c8d9292aa728e7bf0 (patch) | |
tree | 24ff5bdf570a6a9f5a77a517005bffbb35e46b22 /keyboards/nullbitsco | |
parent | 6fd20acf4be76e7a2bd82d3dfd0a9bcca8c507eb (diff) | |
download | qmk_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/nullbitsco')
10 files changed, 23 insertions, 19 deletions
diff --git a/keyboards/nullbitsco/nibble/keymaps/oled/keymap.c b/keyboards/nullbitsco/nibble/keymaps/oled/keymap.c index c9988848d..0e0a152ec 100644 --- a/keyboards/nullbitsco/nibble/keymaps/oled/keymap.c +++ b/keyboards/nullbitsco/nibble/keymaps/oled/keymap.c | |||
@@ -41,7 +41,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
41 | ), | 41 | ), |
42 | }; | 42 | }; |
43 | 43 | ||
44 | #ifdef OLED_DRIVER_ENABLE | 44 | #ifdef OLED_ENABLE |
45 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_180; } | 45 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_180; } |
46 | 46 | ||
47 | static void render_logo(void) { | 47 | static void render_logo(void) { |
diff --git a/keyboards/nullbitsco/nibble/keymaps/oled/rules.mk b/keyboards/nullbitsco/nibble/keymaps/oled/rules.mk index 48a51b225..d34d066de 100644 --- a/keyboards/nullbitsco/nibble/keymaps/oled/rules.mk +++ b/keyboards/nullbitsco/nibble/keymaps/oled/rules.mk | |||
@@ -1 +1,2 @@ | |||
1 | OLED_DRIVER_ENABLE = yes \ No newline at end of file | 1 | OLED_ENABLE = yes |
2 | OLED_DRIVER = SSD1306 | ||
diff --git a/keyboards/nullbitsco/nibble/keymaps/oled_bongocat/animation_frames.h b/keyboards/nullbitsco/nibble/keymaps/oled_bongocat/animation_frames.h index bef80febe..ac1e8dee3 100644 --- a/keyboards/nullbitsco/nibble/keymaps/oled_bongocat/animation_frames.h +++ b/keyboards/nullbitsco/nibble/keymaps/oled_bongocat/animation_frames.h | |||
@@ -14,7 +14,7 @@ | |||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
15 | */ | 15 | */ |
16 | #pragma once | 16 | #pragma once |
17 | #ifdef OLED_DRIVER_ENABLE | 17 | #ifdef OLED_ENABLE |
18 | 18 | ||
19 | // Enable OLED bitmpa compression selectively. | 19 | // Enable OLED bitmpa compression selectively. |
20 | #define USE_OLED_BITMAP_COMPRESSION | 20 | #define USE_OLED_BITMAP_COMPRESSION |
@@ -401,4 +401,4 @@ static const char PROGMEM tap_frames[NUM_TAP_FRAMES][NUM_OLED_BYTES] = { | |||
401 | }, | 401 | }, |
402 | }; | 402 | }; |
403 | #endif //USE_BITMAP_COMPRESSION | 403 | #endif //USE_BITMAP_COMPRESSION |
404 | #endif //OLED_DRIVER_ENABLE \ No newline at end of file | 404 | #endif //OLED_ENABLE |
diff --git a/keyboards/nullbitsco/nibble/keymaps/oled_bongocat/keymap.c b/keyboards/nullbitsco/nibble/keymaps/oled_bongocat/keymap.c index d9365f54b..5c4e31ab6 100644 --- a/keyboards/nullbitsco/nibble/keymaps/oled_bongocat/keymap.c +++ b/keyboards/nullbitsco/nibble/keymaps/oled_bongocat/keymap.c | |||
@@ -86,7 +86,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { | |||
86 | return true; | 86 | return true; |
87 | } | 87 | } |
88 | 88 | ||
89 | #ifdef OLED_DRIVER_ENABLE | 89 | #ifdef OLED_ENABLE |
90 | #define IDLE_FRAME_DURATION 200 // Idle animation iteration rate in ms | 90 | #define IDLE_FRAME_DURATION 200 // Idle animation iteration rate in ms |
91 | 91 | ||
92 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; } | 92 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; } |
@@ -173,7 +173,7 @@ void oled_task_user(void) { | |||
173 | 173 | ||
174 | // Animate tap | 174 | // Animate tap |
175 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | 175 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
176 | #ifdef OLED_DRIVER_ENABLE | 176 | #ifdef OLED_ENABLE |
177 | // Check if non-mod | 177 | // Check if non-mod |
178 | if ((keycode >= KC_A && keycode <= KC_0) || (keycode >= KC_TAB && keycode <= KC_SLASH)) { | 178 | if ((keycode >= KC_A && keycode <= KC_0) || (keycode >= KC_TAB && keycode <= KC_SLASH)) { |
179 | if (record->event.pressed) { | 179 | if (record->event.pressed) { |
@@ -192,7 +192,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
192 | case PROG: | 192 | case PROG: |
193 | if (record->event.pressed) { | 193 | if (record->event.pressed) { |
194 | rgblight_disable_noeeprom(); | 194 | rgblight_disable_noeeprom(); |
195 | #ifdef OLED_DRIVER_ENABLE | 195 | #ifdef OLED_ENABLE |
196 | oled_off(); | 196 | oled_off(); |
197 | #endif | 197 | #endif |
198 | bootloader_jump(); | 198 | bootloader_jump(); |
diff --git a/keyboards/nullbitsco/nibble/keymaps/oled_bongocat/rules.mk b/keyboards/nullbitsco/nibble/keymaps/oled_bongocat/rules.mk index c7ffad546..db6a98385 100644 --- a/keyboards/nullbitsco/nibble/keymaps/oled_bongocat/rules.mk +++ b/keyboards/nullbitsco/nibble/keymaps/oled_bongocat/rules.mk | |||
@@ -1,3 +1,4 @@ | |||
1 | OLED_DRIVER_ENABLE = yes | 1 | OLED_ENABLE = yes |
2 | OLED_DRIVER = SSD1306 | ||
2 | WPM_ENABLE = yes | 3 | WPM_ENABLE = yes |
3 | VIA_ENABLE = yes \ No newline at end of file | 4 | VIA_ENABLE = yes |
diff --git a/keyboards/nullbitsco/nibble/keymaps/oled_status/config.h b/keyboards/nullbitsco/nibble/keymaps/oled_status/config.h index bdb970ff5..603bde686 100644 --- a/keyboards/nullbitsco/nibble/keymaps/oled_status/config.h +++ b/keyboards/nullbitsco/nibble/keymaps/oled_status/config.h | |||
@@ -16,6 +16,6 @@ | |||
16 | #pragma once | 16 | #pragma once |
17 | 17 | ||
18 | // Referenced custom font | 18 | // Referenced custom font |
19 | #ifdef OLED_DRIVER_ENABLE | 19 | #ifdef OLED_ENABLE |
20 | # define OLED_FONT_H "keyboards/nullbitsco/nibble/keymaps/oled_status/glcdfont.c" | 20 | # define OLED_FONT_H "keyboards/nullbitsco/nibble/keymaps/oled_status/glcdfont.c" |
21 | #endif | 21 | #endif |
diff --git a/keyboards/nullbitsco/nibble/keymaps/oled_status/keymap.c b/keyboards/nullbitsco/nibble/keymaps/oled_status/keymap.c index b3da17395..161eeedc3 100644 --- a/keyboards/nullbitsco/nibble/keymaps/oled_status/keymap.c +++ b/keyboards/nullbitsco/nibble/keymaps/oled_status/keymap.c | |||
@@ -15,7 +15,7 @@ | |||
15 | */ | 15 | */ |
16 | #include QMK_KEYBOARD_H | 16 | #include QMK_KEYBOARD_H |
17 | 17 | ||
18 | #ifdef OLED_DRIVER_ENABLE | 18 | #ifdef OLED_ENABLE |
19 | # include "oled_display.h" | 19 | # include "oled_display.h" |
20 | #endif | 20 | #endif |
21 | 21 | ||
@@ -44,7 +44,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
44 | }; | 44 | }; |
45 | // clang-format on | 45 | // clang-format on |
46 | 46 | ||
47 | #ifdef OLED_DRIVER_ENABLE | 47 | #ifdef OLED_ENABLE |
48 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { | 48 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { |
49 | oled_timer = timer_read32(); | 49 | oled_timer = timer_read32(); |
50 | set_oled_mode(OLED_MODE_IDLE); | 50 | set_oled_mode(OLED_MODE_IDLE); |
@@ -66,7 +66,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
66 | switch (keycode) { | 66 | switch (keycode) { |
67 | case RGB_TOG: | 67 | case RGB_TOG: |
68 | if (record->event.pressed) { | 68 | if (record->event.pressed) { |
69 | #ifdef OLED_DRIVER_ENABLE | 69 | #ifdef OLED_ENABLE |
70 | process_record_keymap_oled(keycode); | 70 | process_record_keymap_oled(keycode); |
71 | #endif | 71 | #endif |
72 | } | 72 | } |
@@ -82,12 +82,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
82 | bool encoder_update_user(uint8_t index, bool clockwise) { | 82 | bool encoder_update_user(uint8_t index, bool clockwise) { |
83 | if (clockwise) { | 83 | if (clockwise) { |
84 | tap_code(KC_VOLU); | 84 | tap_code(KC_VOLU); |
85 | #ifdef OLED_DRIVER_ENABLE | 85 | #ifdef OLED_ENABLE |
86 | process_record_encoder_oled(KC_VOLU); | 86 | process_record_encoder_oled(KC_VOLU); |
87 | #endif | 87 | #endif |
88 | } else { | 88 | } else { |
89 | tap_code(KC_VOLD); | 89 | tap_code(KC_VOLD); |
90 | #ifdef OLED_DRIVER_ENABLE | 90 | #ifdef OLED_ENABLE |
91 | process_record_encoder_oled(KC_VOLD); | 91 | process_record_encoder_oled(KC_VOLD); |
92 | #endif | 92 | #endif |
93 | } | 93 | } |
diff --git a/keyboards/nullbitsco/nibble/keymaps/oled_status/rules.mk b/keyboards/nullbitsco/nibble/keymaps/oled_status/rules.mk index 51c47cff8..0e39ada47 100644 --- a/keyboards/nullbitsco/nibble/keymaps/oled_status/rules.mk +++ b/keyboards/nullbitsco/nibble/keymaps/oled_status/rules.mk | |||
@@ -1,7 +1,8 @@ | |||
1 | OLED_DRIVER_ENABLE = yes | 1 | OLED_ENABLE = yes |
2 | OLED_DRIVER = SSD1306 | ||
2 | WPM_ENABLE = yes | 3 | WPM_ENABLE = yes |
3 | VIA_ENABLE = yes | 4 | VIA_ENABLE = yes |
4 | 5 | ||
5 | ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes) | 6 | ifeq ($(strip $(OLED_ENABLE)), yes) |
6 | SRC += oled_display.c | 7 | SRC += oled_display.c |
7 | endif | 8 | endif |
diff --git a/keyboards/nullbitsco/scramble/keymaps/oled/keymap.c b/keyboards/nullbitsco/scramble/keymaps/oled/keymap.c index 2081872ac..41356631a 100644 --- a/keyboards/nullbitsco/scramble/keymaps/oled/keymap.c +++ b/keyboards/nullbitsco/scramble/keymaps/oled/keymap.c | |||
@@ -28,7 +28,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
28 | 28 | ||
29 | }; | 29 | }; |
30 | 30 | ||
31 | #ifdef OLED_DRIVER_ENABLE | 31 | #ifdef OLED_ENABLE |
32 | static void render_logo(void) { | 32 | static void render_logo(void) { |
33 | static const char PROGMEM nullbits_logo[] = { | 33 | static const char PROGMEM nullbits_logo[] = { |
34 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 34 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
diff --git a/keyboards/nullbitsco/scramble/keymaps/oled/rules.mk b/keyboards/nullbitsco/scramble/keymaps/oled/rules.mk index c58266213..d34d066de 100644 --- a/keyboards/nullbitsco/scramble/keymaps/oled/rules.mk +++ b/keyboards/nullbitsco/scramble/keymaps/oled/rules.mk | |||
@@ -1 +1,2 @@ | |||
1 | OLED_DRIVER_ENABLE = yes | 1 | OLED_ENABLE = yes |
2 | OLED_DRIVER = SSD1306 | ||