aboutsummaryrefslogtreecommitdiff
path: root/keyboards/helix/pico/post_rules.mk
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/helix/pico/post_rules.mk')
-rw-r--r--keyboards/helix/pico/post_rules.mk147
1 files changed, 147 insertions, 0 deletions
diff --git a/keyboards/helix/pico/post_rules.mk b/keyboards/helix/pico/post_rules.mk
new file mode 100644
index 000000000..38573d75a
--- /dev/null
+++ b/keyboards/helix/pico/post_rules.mk
@@ -0,0 +1,147 @@
1#
2# post_rules.mk contains post-processing rules for the Helix keyboard.
3#
4# Post-processing rules convert keyboard-specific shortcuts (that represent
5# combinations of standard options) into QMK standard options.
6#
7
8define HELIX_CUSTOMISE_MSG
9 $(info Helix Spacific Build Options)
10 $(info - OLED_ENABLE = $(OLED_ENABLE))
11 $(info - LED_BACK_ENABLE = $(LED_BACK_ENABLE))
12 $(info - LED_UNDERGLOW_ENABLE = $(LED_UNDERGLOW_ENABLE))
13 $(info - LED_ANIMATIONS = $(LED_ANIMATIONS))
14 $(info - IOS_DEVICE_ENABLE = $(IOS_DEVICE_ENABLE))
15 $(info )
16endef
17
18define HELIX_HELP_MSG
19 $(info Helix keyboard convenient command line option)
20 $(info - make HELIX=<options> helix/pico:<keymap>)
21 $(info - option= oled | back | under | na | no-ani)
22 $(info - ios | sc | split-common | scan | verbose)
23 $(info - ex.)
24 $(info - make HELIX=oled helix/pico:<keymap>)
25 $(info - make HELIX=back helix/pico:<keymap>)
26 $(info - make HELIX=under helix/pico:<keymap>)
27 $(info - make HELIX=back,na helix/pico:<keymap>)
28 $(info - make HELIX=back,ios helix/pico:<keymap>)
29 $(info )
30endef
31
32 ifneq ($(strip $(HELIX)),)
33 COMMA=,
34 helix_option := $(subst $(COMMA), , $(HELIX))
35 ifneq ($(filter help,$(helix_option)),)
36 $(eval $(call HELIX_HELP_MSG))
37 $(error )
38 endif
39 ifneq ($(filter oled,$(helix_option)),)
40 OLED_ENABLE = yes
41 endif
42 ifneq ($(filter back,$(helix_option)),)
43 LED_BACK_ENABLE = yes
44 else ifneq ($(filter under,$(helix_option)),)
45 LED_UNDERGLOW_ENABLE = yes
46 endif
47 ifneq ($(filter na,$(helix_option)),)
48 LED_ANIMATIONS = no
49 endif
50 ifneq ($(filter no_ani,$(helix_option)),)
51 LED_ANIMATIONS = no
52 endif
53 ifneq ($(filter no-ani,$(helix_option)),)
54 LED_ANIMATIONS = no
55 endif
56 ifneq ($(filter ios,$(helix_option)),)
57 IOS_DEVICE_ENABLE = yes
58 endif
59 ifneq ($(filter sc,$(helix_option)),)
60 SPLIT_KEYBOARD = yes
61 endif
62 ifneq ($(filter split-common,$(helix_option)),)
63 SPLIT_KEYBOARD = yes
64 endif
65 ifneq ($(filter scan,$(helix_option)),)
66 # use DEBUG_MATRIX_SCAN_RATE
67 # see docs/newbs_testing_debugging.md
68 OPT_DEFS += -DDEBUG_MATRIX_SCAN_RATE
69 CONSOLE_ENABLE = yes
70 SHOW_VERBOSE_INFO = yes
71 endif
72 ifneq ($(filter verbose,$(helix_option)),)
73 SHOW_VERBOSE_INFO = yes
74 endif
75 SHOW_HELIX_OPTIONS = yes
76 endif
77
78ifneq ($(strip $(SPLIT_KEYBOARD)), yes)
79 SRC += local_drivers/serial.c
80 KEYBOARD_PATHS += $(HELIX_TOP_DIR)/local_drivers
81
82 # A workaround until #7089 is merged.
83 # serial.c must not be compiled with the -lto option.
84 # The current LIB_SRC has a side effect with the -fno-lto option, so use it.
85 LIB_SRC += local_drivers/serial.c
86
87 CUSTOM_MATRIX = yes
88
89 SRC += pico/matrix.c
90 SRC += pico/split_util.c
91endif
92
93########
94# convert Helix-specific options (that represent combinations of standard options)
95# into QMK standard options.
96
97ifeq ($(strip $(LED_BACK_ENABLE)), yes)
98 RGBLIGHT_ENABLE = yes
99 OPT_DEFS += -DRGBLED_BACK
100 ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes)
101 $(eval $(call HELIX_CUSTOMISE_MSG))
102 $(error LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE both 'yes')
103 endif
104else ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes)
105 RGBLIGHT_ENABLE = yes
106endif
107
108ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes)
109 OPT_DEFS += -DIOS_DEVICE_ENABLE
110endif
111
112ifeq ($(strip $(LED_ANIMATIONS)), yes)
113 OPT_DEFS += -DLED_ANIMATIONS
114endif
115
116ifeq ($(strip $(OLED_ENABLE)), yes)
117 SRC += local_drivers/i2c.c
118 SRC += local_drivers/ssd1306.c
119 KEYBOARD_PATHS += $(HELIX_TOP_DIR)/local_drivers
120 OPT_DEFS += -DOLED_ENABLE
121 ifeq ($(strip $(LOCAL_GLCDFONT)), yes)
122 OPT_DEFS += -DLOCAL_GLCDFONT
123 endif
124endif
125
126ifeq ($(strip $(AUDIO_ENABLE)),yes)
127 ifeq ($(strip $(RGBLIGHT_ENABLE)),yes)
128 LTO_ENABLE = yes
129 endif
130 ifeq ($(strip $(OLED_ENABLE)),yes)
131 LTO_ENABLE = yes
132 endif
133endif
134
135ifneq ($(strip $(SHOW_HELIX_OPTIONS)),)
136 $(eval $(call HELIX_CUSTOMISE_MSG))
137 ifneq ($(strip $(SHOW_VERBOSE_INFO)),)
138 $(info -- RGBLIGHT_ENABLE = $(RGBLIGHT_ENABLE))
139 $(info -- CONSOLE_ENABLE = $(CONSOLE_ENABLE))
140 $(info -- OPT_DEFS = $(OPT_DEFS))
141 $(info -- SPLIT_KEYBOARD = $(SPLIT_KEYBOARD))
142 $(info -- LTO_ENABLE = $(LTO_ENABLE))
143 $(info )
144 endif
145endif
146
147OLED_ENABLE = no # disable OLED in TOP/common_features.mk