diff options
author | Takeshi ISHII <2170248+mtei@users.noreply.github.com> | 2020-12-26 02:38:07 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-26 02:38:07 +0900 |
commit | 5544bf8524c77ad09d32cf2b0f6dc40f7b05ee01 (patch) | |
tree | 88774de1c64e4c9a37beeefe6a8025805aed0c83 | |
parent | 7ca4b619223260d17bcc0d065a02d1bbdce436b8 (diff) | |
download | qmk_firmware-5544bf8524c77ad09d32cf2b0f6dc40f7b05ee01.tar.gz qmk_firmware-5544bf8524c77ad09d32cf2b0f6dc40f7b05ee01.zip |
[Keymap] update rules.mk and config.h of `helix/rev2:five_rows` (#11302)
* update keyboards/helix/rev2/keymaps/five_rows/rules.mk: oled selection, led animation selection
* add OLED_UPDATE_INTERVAL support into keyboards/helix/rev2/keymaps/five_rows/oled_display.c
Support for OLED_UPDATE_INTERVAL, even for older types of OLED tasks.
* Add 'HELIX=debug/no-debug' option into 'helix/rev2/keymaps/five_rows/rules.mk'
-rw-r--r-- | keyboards/helix/rev2/keymaps/five_rows/config.h | 31 | ||||
-rw-r--r-- | keyboards/helix/rev2/keymaps/five_rows/oled_display.c | 10 | ||||
-rw-r--r-- | keyboards/helix/rev2/keymaps/five_rows/rules.mk | 57 |
3 files changed, 75 insertions, 23 deletions
diff --git a/keyboards/helix/rev2/keymaps/five_rows/config.h b/keyboards/helix/rev2/keymaps/five_rows/config.h index 538859bc3..cd76af4fa 100644 --- a/keyboards/helix/rev2/keymaps/five_rows/config.h +++ b/keyboards/helix/rev2/keymaps/five_rows/config.h | |||
@@ -3,6 +3,7 @@ This is the c configuration file for the keymap | |||
3 | 3 | ||
4 | Copyright 2012 Jun Wako <wakojun@gmail.com> | 4 | Copyright 2012 Jun Wako <wakojun@gmail.com> |
5 | Copyright 2015 Jack Humbert | 5 | Copyright 2015 Jack Humbert |
6 | Copyright 2020 mtei | ||
6 | 7 | ||
7 | This program is free software: you can redistribute it and/or modify | 8 | This program is free software: you can redistribute it and/or modify |
8 | it under the terms of the GNU General Public License as published by | 9 | it under the terms of the GNU General Public License as published by |
@@ -27,12 +28,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
27 | /* when TAPPING_TERM >= 500 same effect PERMISSIVE_HOLD. | 28 | /* when TAPPING_TERM >= 500 same effect PERMISSIVE_HOLD. |
28 | see tmk_core/common/action_tapping.c */ | 29 | see tmk_core/common/action_tapping.c */ |
29 | 30 | ||
31 | #undef OLED_UPDATE_INTERVAL | ||
32 | #define OLED_UPDATE_INTERVAL 50 | ||
33 | |||
30 | // place overrides here | 34 | // place overrides here |
31 | 35 | ||
32 | // If you need more program area, try select and reduce rgblight modes to use. | 36 | // If you need more program area, try select and reduce rgblight modes to use. |
33 | 37 | ||
34 | // Selection of RGBLIGHT MODE to use. | 38 | // Selection of RGBLIGHT MODE to use. |
39 | #undef RGBLIGHT_ANIMATIONS | ||
40 | #undef RGBLIGHT_EFFECT_BREATHING | ||
41 | #undef RGBLIGHT_EFFECT_RAINBOW_MOOD | ||
42 | #undef RGBLIGHT_EFFECT_RAINBOW_SWIRL | ||
43 | #undef RGBLIGHT_EFFECT_SNAKE | ||
44 | #undef RGBLIGHT_EFFECT_KNIGHT | ||
45 | #undef RGBLIGHT_EFFECT_CHRISTMAS | ||
46 | #undef RGBLIGHT_EFFECT_STATIC_GRADIENT | ||
47 | #undef RGBLIGHT_EFFECT_RGB_TEST | ||
48 | #undef RGBLIGHT_EFFECT_ALTERNATING | ||
49 | |||
35 | #if defined(LED_ANIMATIONS) | 50 | #if defined(LED_ANIMATIONS) |
51 | # if LED_ANIMATIONS_LEVEL > 1 | ||
36 | #define RGBLIGHT_EFFECT_BREATHING | 52 | #define RGBLIGHT_EFFECT_BREATHING |
37 | #define RGBLIGHT_EFFECT_RAINBOW_MOOD | 53 | #define RGBLIGHT_EFFECT_RAINBOW_MOOD |
38 | #define RGBLIGHT_EFFECT_RAINBOW_SWIRL | 54 | #define RGBLIGHT_EFFECT_RAINBOW_SWIRL |
@@ -42,6 +58,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
42 | #define RGBLIGHT_EFFECT_STATIC_GRADIENT | 58 | #define RGBLIGHT_EFFECT_STATIC_GRADIENT |
43 | //#define RGBLIGHT_EFFECT_RGB_TEST | 59 | //#define RGBLIGHT_EFFECT_RGB_TEST |
44 | //#define RGBLIGHT_EFFECT_ALTERNATING | 60 | //#define RGBLIGHT_EFFECT_ALTERNATING |
61 | # else | ||
62 | #define RGBLIGHT_EFFECT_BREATHING | ||
63 | #define RGBLIGHT_EFFECT_RAINBOW_MOOD | ||
64 | //#define RGBLIGHT_EFFECT_RAINBOW_SWIRL | ||
65 | //#define RGBLIGHT_EFFECT_SNAKE | ||
66 | //#define RGBLIGHT_EFFECT_KNIGHT | ||
67 | //#define RGBLIGHT_EFFECT_CHRISTMAS | ||
68 | #define RGBLIGHT_EFFECT_STATIC_GRADIENT | ||
69 | //#define RGBLIGHT_EFFECT_RGB_TEST | ||
70 | //#define RGBLIGHT_EFFECT_ALTERNATING | ||
71 | # endif | ||
45 | #endif | 72 | #endif |
46 | 73 | ||
47 | #endif /* CONFIG_USER_H */ | 74 | #endif /* CONFIG_USER_H */ |
75 | |||
76 | #ifdef DEBUG_CONFIG | ||
77 | # include "debug_config.h" | ||
78 | #endif | ||
diff --git a/keyboards/helix/rev2/keymaps/five_rows/oled_display.c b/keyboards/helix/rev2/keymaps/five_rows/oled_display.c index 127d80cc7..689efe4c8 100644 --- a/keyboards/helix/rev2/keymaps/five_rows/oled_display.c +++ b/keyboards/helix/rev2/keymaps/five_rows/oled_display.c | |||
@@ -163,6 +163,10 @@ void render_status(void) { | |||
163 | } | 163 | } |
164 | 164 | ||
165 | # ifdef SSD1306OLED | 165 | # ifdef SSD1306OLED |
166 | # if OLED_UPDATE_INTERVAL > 0 | ||
167 | uint16_t oled_update_timeout; | ||
168 | # endif | ||
169 | |||
166 | void iota_gfx_task_user(void) { | 170 | void iota_gfx_task_user(void) { |
167 | struct CharacterMatrix matrix; | 171 | struct CharacterMatrix matrix; |
168 | 172 | ||
@@ -172,6 +176,12 @@ void iota_gfx_task_user(void) { | |||
172 | } | 176 | } |
173 | # endif | 177 | # endif |
174 | 178 | ||
179 | #if OLED_UPDATE_INTERVAL > 0 | ||
180 | if (timer_elapsed(oled_update_timeout) < OLED_UPDATE_INTERVAL) { | ||
181 | return; | ||
182 | } | ||
183 | oled_update_timeout = timer_read(); | ||
184 | #endif | ||
175 | matrix_clear(&matrix); | 185 | matrix_clear(&matrix); |
176 | if (is_keyboard_master()) { | 186 | if (is_keyboard_master()) { |
177 | render_status(&matrix); | 187 | render_status(&matrix); |
diff --git a/keyboards/helix/rev2/keymaps/five_rows/rules.mk b/keyboards/helix/rev2/keymaps/five_rows/rules.mk index 83cdb30d0..fbde2fe6a 100644 --- a/keyboards/helix/rev2/keymaps/five_rows/rules.mk +++ b/keyboards/helix/rev2/keymaps/five_rows/rules.mk | |||
@@ -12,6 +12,7 @@ | |||
12 | # yes, yes +3200 | 12 | # yes, yes +3200 |
13 | # no, yes +400 | 13 | # no, yes +400 |
14 | LTO_ENABLE = no # if firmware size over limit, try this option | 14 | LTO_ENABLE = no # if firmware size over limit, try this option |
15 | LED_ANIMATIONS = yes | ||
15 | 16 | ||
16 | # Helix Spacific Build Options | 17 | # Helix Spacific Build Options |
17 | # you can uncomment and edit follows 7 Variables | 18 | # you can uncomment and edit follows 7 Variables |
@@ -26,8 +27,8 @@ HELIX_ROWS = 5 # Helix Rows is 4 or 5 | |||
26 | 27 | ||
27 | ifneq ($(strip $(HELIX)),) | 28 | ifneq ($(strip $(HELIX)),) |
28 | define KEYMAP_OPTION_PARSE | 29 | define KEYMAP_OPTION_PARSE |
29 | # $xinfo .$1.x #debug | 30 | # parse 'dispoff', 'consloe', 'na', 'ani', 'mini-ani' |
30 | # parse 'dispoff', 'consle', 'stdole', 'oled', 'sc' | 31 | $(if $(SHOW_PARCE),$(info parse -$1-)) #debug |
31 | ifeq ($(strip $1),dispoff) | 32 | ifeq ($(strip $1),dispoff) |
32 | OLED_ENABLE = no | 33 | OLED_ENABLE = no |
33 | OLED_DRIVER_ENABLE = no | 34 | OLED_DRIVER_ENABLE = no |
@@ -37,19 +38,26 @@ ifneq ($(strip $(HELIX)),) | |||
37 | ifeq ($(strip $1),console) | 38 | ifeq ($(strip $1),console) |
38 | CONSOLE_ENABLE = yes | 39 | CONSOLE_ENABLE = yes |
39 | endif | 40 | endif |
40 | ifeq ($(strip $1),stdole) | 41 | ifeq ($(strip $1),debug) |
41 | ## make HELIX=stdole helix:five_rows -- use TOP/drivers/oled/oled_driver.c | 42 | DEBUG_CONFIG = yes |
42 | OLED_ENABLE = new | ||
43 | endif | 43 | endif |
44 | ifeq ($(strip $1),oled) | 44 | ifneq ($(filter nodebug no-debug no_debug,$(strip $1)),) |
45 | ## make HELIX=oled helix:five_rows -- use helix/local_drivers/ssd1306.c | 45 | DEBUG_CONFIG = no |
46 | OLED_ENABLE = yes | ||
47 | endif | 46 | endif |
48 | ifeq ($(strip $1),back) | 47 | ifneq ($(filter na no_ani no-ani,$(strip $1)),) |
49 | LED_BACK_ENABLE = yes | 48 | LED_ANIMATIONS = no |
50 | endif | 49 | endif |
51 | ifeq ($(strip $1),sc) | 50 | ifneq ($(filter mini-ani mini_ani,$(strip $1)),) |
52 | SPLIT_KEYBOARD = yes | 51 | LED_ANIMATIONS = mini |
52 | endif | ||
53 | ifneq ($(filter ani animation,$(strip $1)),) | ||
54 | LED_ANIMATIONS = yes | ||
55 | endif | ||
56 | ifeq ($(strip $1),lto) | ||
57 | LTO_ENABLE = yes | ||
58 | endif | ||
59 | ifneq ($(filter nolto no-lto no_lto,$(strip $1)),) | ||
60 | LTO_ENABLE = no | ||
53 | endif | 61 | endif |
54 | endef # end of KEYMAP_OPTION_PARSE | 62 | endef # end of KEYMAP_OPTION_PARSE |
55 | 63 | ||
@@ -58,20 +66,23 @@ ifneq ($(strip $(HELIX)),) | |||
58 | $(call KEYMAP_OPTION_PARSE,$(A_OPTION_NAME)))) | 66 | $(call KEYMAP_OPTION_PARSE,$(A_OPTION_NAME)))) |
59 | endif | 67 | endif |
60 | 68 | ||
61 | ifeq ($(strip $(OLED_ENABLE)), new) | 69 | ifeq ($(strip $(LED_ANIMATIONS)), yes) |
62 | OLED_DRIVER_ENABLE = yes | 70 | OPT_DEFS += -DLED_ANIMATIONS_LEVEL=2 |
63 | OLED_ENABLE = no | ||
64 | SRC += oled_display.c | ||
65 | ifeq ($(strip $(LOCAL_GLCDFONT)), yes) | ||
66 | OPT_DEFS += -DOLED_FONT_H=\<helixfont.h\> | ||
67 | else | ||
68 | OPT_DEFS += -DOLED_FONT_H=\"common/glcdfont.c\" | ||
69 | endif | ||
70 | endif | 71 | endif |
71 | ifeq ($(strip $(OLED_ENABLE)), yes) | 72 | |
72 | SRC += oled_display.c | 73 | ifeq ($(strip $(LED_ANIMATIONS)), mini) |
74 | OPT_DEFS += -DLED_ANIMATIONS_LEVEL=1 | ||
75 | LED_ANIMATIONS = yes | ||
76 | endif | ||
77 | |||
78 | ifeq ($(strip $(DEBUG_CONFIG)), yes) | ||
79 | OPT_DEFS += -DDEBUG_CONFIG | ||
73 | endif | 80 | endif |
74 | 81 | ||
75 | # convert Helix-specific options (that represent combinations of standard options) | 82 | # convert Helix-specific options (that represent combinations of standard options) |
76 | # into QMK standard options. | 83 | # into QMK standard options. |
77 | include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) | 84 | include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) |
85 | |||
86 | ifeq ($(strip $(OLED_ENABLE)), yes) | ||
87 | SRC += oled_display.c | ||
88 | endif | ||