aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/action.c2
-rw-r--r--common/layer_switch.c4
-rw-r--r--common/layer_switch.h15
-rw-r--r--keyboard/gh60/config.h3
4 files changed, 23 insertions, 1 deletions
diff --git a/common/action.c b/common/action.c
index 4fafbfa79..1b84d1e88 100644
--- a/common/action.c
+++ b/common/action.c
@@ -517,6 +517,7 @@ static void process_action(keyrecord_t *record)
517 } 517 }
518 break; 518 break;
519 519
520#ifndef NO_ACTION_OVERLAY
520 case ACT_OVERLAY: 521 case ACT_OVERLAY:
521 switch (action.layer.code) { 522 switch (action.layer.code) {
522 // Overlay Invert bit4 523 // Overlay Invert bit4
@@ -670,6 +671,7 @@ static void process_action(keyrecord_t *record)
670 break; 671 break;
671 } 672 }
672 break; 673 break;
674#endif
673 675
674 /* Extentions */ 676 /* Extentions */
675 case ACT_MACRO: 677 case ACT_MACRO:
diff --git a/common/layer_switch.c b/common/layer_switch.c
index 19e286f88..815d1e5f2 100644
--- a/common/layer_switch.c
+++ b/common/layer_switch.c
@@ -98,6 +98,7 @@ void keymap_debug(void)
98 98
99 99
100 100
101#ifndef NO_ACTION_OVERLAY
101/* 102/*
102 * Overlay Layer (16-31 = 0-15|0x10) 103 * Overlay Layer (16-31 = 0-15|0x10)
103 */ 104 */
@@ -169,12 +170,14 @@ void overlay_debug(void)
169{ 170{
170 debug_hex16(overlay_stat); debug("("); debug_dec(overlay_get_layer()); debug(")"); 171 debug_hex16(overlay_stat); debug("("); debug_dec(overlay_get_layer()); debug(")");
171} 172}
173#endif
172 174
173action_t layer_switch_get_action(key_t key) 175action_t layer_switch_get_action(key_t key)
174{ 176{
175 action_t action; 177 action_t action;
176 action.code = ACTION_TRANSPARENT; 178 action.code = ACTION_TRANSPARENT;
177 179
180#ifndef NO_ACTION_OVERLAY
178 /* overlay: top layer first */ 181 /* overlay: top layer first */
179 for (int8_t i = 15; i >= 0; i--) { 182 for (int8_t i = 15; i >= 0; i--) {
180 if (overlay_stat & (1<<i)) { 183 if (overlay_stat & (1<<i)) {
@@ -184,6 +187,7 @@ action_t layer_switch_get_action(key_t key)
184 } 187 }
185 } 188 }
186 } 189 }
190#endif
187 191
188 /* keymap: top layer first */ 192 /* keymap: top layer first */
189 for (int8_t i = 15; i >= 0; i--) { 193 for (int8_t i = 15; i >= 0; i--) {
diff --git a/common/layer_switch.h b/common/layer_switch.h
index a566ab12b..5de6cb01c 100644
--- a/common/layer_switch.h
+++ b/common/layer_switch.h
@@ -57,6 +57,7 @@ void keymap_debug(void);
57/* 57/*
58 * Overlay Layer 58 * Overlay Layer
59 */ 59 */
60#ifndef NO_ACTION_OVERLAY
60extern uint16_t overlay_stat; 61extern uint16_t overlay_stat;
61/* return current active layer */ 62/* return current active layer */
62uint8_t overlay_get_layer(void); 63uint8_t overlay_get_layer(void);
@@ -71,6 +72,20 @@ void overlay_or(uint16_t stat);
71void overlay_and(uint16_t stat); 72void overlay_and(uint16_t stat);
72void overlay_xor(uint16_t stat); 73void overlay_xor(uint16_t stat);
73void overlay_debug(void); 74void overlay_debug(void);
75#else
76#define overlay_stat 0
77#define overlay_get_layer()
78#define overlay_clear()
79#define overlay_set(stat)
80#define overlay_move(layer)
81#define overlay_on(layer)
82#define overlay_off(layer)
83#define overlay_invert(layer)
84#define overlay_or(stat)
85#define overlay_and(stat)
86#define overlay_xor(stat)
87#define overlay_debug()
88#endif
74 89
75 90
76 91
diff --git a/keyboard/gh60/config.h b/keyboard/gh60/config.h
index 64a080e1c..bb4277ae6 100644
--- a/keyboard/gh60/config.h
+++ b/keyboard/gh60/config.h
@@ -58,8 +58,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
58 58
59/* disable debug print */ 59/* disable debug print */
60//#define NO_DEBUG 60//#define NO_DEBUG
61
62/* disable print */ 61/* disable print */
63//#define NO_PRINT 62//#define NO_PRINT
64 63
64#define NO_ACTION_OVERLAY
65
65#endif 66#endif