summaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2020-04-01 21:06:22 +0100
committerFlorian Didron <fdidron@users.noreply.github.com>2020-06-12 17:00:27 +0900
commit3cc7234810250ca45a18399a08454f65c3a042b6 (patch)
treedaf5d0564e8b5d4f540a0080f6823d229990128c /quantum
parent9362382ac0cb3fb0f0d4c8ebbcdcf769fbba670a (diff)
Strip out features to allow minimum firmware sizes (#8645)
Diffstat (limited to 'quantum')
-rw-r--r--quantum/keymap_common.c14
-rw-r--r--quantum/quantum.c2
2 files changed, 16 insertions, 0 deletions
diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c
index f34ba26e5a..570d4798de 100644
--- a/quantum/keymap_common.c
+++ b/quantum/keymap_common.c
@@ -51,17 +51,23 @@ action_t action_for_key(uint8_t layer, keypos_t key) {
action_t action = {};
uint8_t action_layer, when, mod;
+ (void)action_layer;
+ (void)when;
+ (void)mod;
+
switch (keycode) {
case KC_A ... KC_EXSEL:
case KC_LCTRL ... KC_RGUI:
action.code = ACTION_KEY(keycode);
break;
+#ifdef EXTRAKEY_ENABLE
case KC_SYSTEM_POWER ... KC_SYSTEM_WAKE:
action.code = ACTION_USAGE_SYSTEM(KEYCODE2SYSTEM(keycode));
break;
case KC_AUDIO_MUTE ... KC_BRIGHTNESS_DOWN:
action.code = ACTION_USAGE_CONSUMER(KEYCODE2CONSUMER(keycode));
break;
+#endif
#ifdef MOUSEKEY_ENABLE
case KC_MS_UP ... KC_MS_ACCEL2:
action.code = ACTION_MOUSEKEY(keycode);
@@ -93,6 +99,7 @@ action_t action_for_key(uint8_t layer, keypos_t key) {
action.code = ACTION_MACRO(keycode & 0xFF);
break;
#endif
+#ifndef NO_ACTION_LAYER
case QK_LAYER_TAP ... QK_LAYER_TAP_MAX:
action.code = ACTION_LAYER_TAP_KEY((keycode >> 0x8) & 0xF, keycode & 0xFF);
break;
@@ -117,6 +124,8 @@ action_t action_for_key(uint8_t layer, keypos_t key) {
action_layer = keycode & 0xFF;
action.code = ACTION_LAYER_TOGGLE(action_layer);
break;
+#endif
+#ifndef NO_ACTION_ONESHOT
case QK_ONE_SHOT_LAYER ... QK_ONE_SHOT_LAYER_MAX:;
// OSL(action_layer) - One-shot action_layer
action_layer = keycode & 0xFF;
@@ -127,6 +136,8 @@ action_t action_for_key(uint8_t layer, keypos_t key) {
mod = mod_config(keycode & 0xFF);
action.code = ACTION_MODS_ONESHOT(mod);
break;
+#endif
+#ifndef NO_ACTION_LAYER
case QK_LAYER_TAP_TOGGLE ... QK_LAYER_TAP_TOGGLE_MAX:
action.code = ACTION_LAYER_TAP_TOGGLE(keycode & 0xFF);
break;
@@ -135,10 +146,13 @@ action_t action_for_key(uint8_t layer, keypos_t key) {
action_layer = (keycode >> 4) & 0xF;
action.code = ACTION_LAYER_MODS(action_layer, mod);
break;
+#endif
+#ifndef NO_ACTION_TAPPING
case QK_MOD_TAP ... QK_MOD_TAP_MAX:
mod = mod_config((keycode >> 0x8) & 0x1F);
action.code = ACTION_MODS_TAP_KEY(mod, keycode & 0xFF);
break;
+#endif
#ifdef SWAP_HANDS_ENABLE
case QK_SWAP_HANDS ... QK_SWAP_HANDS_MAX:
action.code = ACTION(ACT_SWAP_HANDS, keycode & 0xff);
diff --git a/quantum/quantum.c b/quantum/quantum.c
index c67eb9b6cb..8a80f04197 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -284,9 +284,11 @@ bool process_record_quantum(keyrecord_t *record) {
if (record->event.pressed) {
switch (keycode) {
+#ifndef NO_RESET
case RESET:
reset_keyboard();
return false;
+#endif
#ifndef NO_DEBUG
case DEBUG:
debug_enable ^= 1;