From 27cb3f4fab679a94c959220601c6903464460962 Mon Sep 17 00:00:00 2001 From: tmk Date: Tue, 19 Mar 2013 16:05:53 +0900 Subject: [PATCH] Add COMMAND_ENABLE build option --- common.mk | 6 +++++- common/command.h | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/common.mk b/common.mk index 2ce4e32d..e4c9fb26 100644 --- a/common.mk +++ b/common.mk @@ -5,7 +5,6 @@ SRC += $(COMMON_DIR)/host.c \ $(COMMON_DIR)/action_macro.c \ $(COMMON_DIR)/layer_switch.c \ $(COMMON_DIR)/keymap.c \ - $(COMMON_DIR)/command.c \ $(COMMON_DIR)/timer.c \ $(COMMON_DIR)/print.c \ $(COMMON_DIR)/debug.c \ @@ -36,6 +35,11 @@ else OPT_DEFS += -DNO_DEBUG endif +ifdef COMMAND_ENABLE + SRC += $(COMMON_DIR)/command.c + OPT_DEFS += -DCOMMAND_ENABLE +endif + ifdef NKRO_ENABLE OPT_DEFS += -DNKRO_ENABLE endif diff --git a/common/command.h b/common/command.h index dafd4d0f..be739faf 100644 --- a/common/command.h +++ b/common/command.h @@ -18,8 +18,12 @@ along with this program. If not, see . #ifndef COMMAND_H #define COMMAND +#ifdef COMMAND_ENABLE bool command_proc(uint8_t code); /* This allows to extend commands. Return 0 when command is not processed. */ bool command_extra(uint8_t code); +#else +#define command_proc(code) false +#endif #endif