From 3cc7234810250ca45a18399a08454f65c3a042b6 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Wed, 1 Apr 2020 21:06:22 +0100 Subject: Strip out features to allow minimum firmware sizes (#8645) --- tmk_core/common/action.c | 3 ++- tmk_core/common/action_layer.h | 14 +++++++------- tmk_core/common/util.c | 6 +++--- 3 files changed, 12 insertions(+), 11 deletions(-) (limited to 'tmk_core/common') diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index 19c3569d55..74db245c12 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -775,11 +775,12 @@ void register_code(uint8_t code) { add_mods(MOD_BIT(code)); send_keyboard_report(); } +#ifdef EXTRAKEY_ENABLE else if IS_SYSTEM(code) { host_system_send(KEYCODE2SYSTEM(code)); } else if IS_CONSUMER(code) { host_consumer_send(KEYCODE2CONSUMER(code)); } - +#endif #ifdef MOUSEKEY_ENABLE else if IS_MOUSEKEY(code) { diff --git a/tmk_core/common/action_layer.h b/tmk_core/common/action_layer.h index b8562f5a46..c283d26232 100644 --- a/tmk_core/common/action_layer.h +++ b/tmk_core/common/action_layer.h @@ -82,13 +82,13 @@ void layer_xor(layer_state_t state); # define layer_debug() # define layer_clear() -# define layer_move(layer) -# define layer_on(layer) -# define layer_off(layer) -# define layer_invert(layer) -# define layer_or(state) -# define layer_and(state) -# define layer_xor(state) +# define layer_move(layer) (void)layer +# define layer_on(layer) (void)layer +# define layer_off(layer) (void)layer +# define layer_invert(layer) (void)layer +# define layer_or(state) (void)state +# define layer_and(state) (void)state +# define layer_xor(state) (void)state #endif layer_state_t layer_state_set_user(layer_state_t state); diff --git a/tmk_core/common/util.c b/tmk_core/common/util.c index f4f018de8d..861cca0054 100644 --- a/tmk_core/common/util.c +++ b/tmk_core/common/util.c @@ -18,7 +18,7 @@ along with this program. If not, see . #include "util.h" // bit population - return number of on-bit -uint8_t bitpop(uint8_t bits) { +__attribute__((noinline)) uint8_t bitpop(uint8_t bits) { uint8_t c; for (c = 0; bits; c++) bits &= bits - 1; return c; @@ -42,7 +42,7 @@ uint8_t bitpop32(uint32_t bits) { // most significant on-bit - return highest location of on-bit // NOTE: return 0 when bit0 is on or all bits are off -uint8_t biton(uint8_t bits) { +__attribute__((noinline)) uint8_t biton(uint8_t bits) { uint8_t n = 0; if (bits >> 4) { bits >>= 4; @@ -105,7 +105,7 @@ uint8_t biton32(uint32_t bits) { return n; } -uint8_t bitrev(uint8_t bits) { +__attribute__((noinline)) uint8_t bitrev(uint8_t bits) { bits = (bits & 0x0f) << 4 | (bits & 0xf0) >> 4; bits = (bits & 0b00110011) << 2 | (bits & 0b11001100) >> 2; bits = (bits & 0b01010101) << 1 | (bits & 0b10101010) >> 1; -- cgit v1.2.3