diff options
author | Amir Hammad <amir.hammad@hotmail.com> | 2016-06-24 01:16:57 +0200 |
---|---|---|
committer | Amir Hammad <amir.hammad@hotmail.com> | 2016-06-25 10:09:55 +0200 |
commit | e59f23ad5c60dc08f281ccc7a794f4482e55ad00 (patch) | |
tree | f8f16c81d856a003d9b455a2bf04028506491556 | |
parent | 40192caee01bd5fe6c8ed2c61798c95782ccfdd2 (diff) | |
download | secure-hid-e59f23ad5c60dc08f281ccc7a794f4482e55ad00.tar.gz secure-hid-e59f23ad5c60dc08f281ccc7a794f4482e55ad00.tar.bz2 secure-hid-e59f23ad5c60dc08f281ccc7a794f4482e55ad00.zip |
Don't compile usart_helpers.o when USART_DEBUG is not defined
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
-rw-r--r-- | Makefile | 5 | ||||
-rw-r--r-- | src/usart_helpers.h | 3 |
2 files changed, 6 insertions, 2 deletions
@@ -98,6 +98,11 @@ SRCS := $(sort $(notdir $(wildcard $(SRCDIR)/*.cpp))) OBJSDEMO += $(patsubst %.cpp, build/%.o ,$(SRCS)) OBJS = $(filter-out $(BINARY).o, $(OBJSDEMO)) +ifndef USART_DEBUG +OBJS := $(filter-out build/usart_helpers.o, $(OBJS)) +OBJSDEMO := $(filter-out build/usart_helpers.o, $(OBJSDEMO)) +endif + INCLUDE_DIR = $(OPENCM3_DIR)/include LIB_DIR = $(OPENCM3_DIR)/lib diff --git a/src/usart_helpers.h b/src/usart_helpers.h index 2a2f561..eef43fa 100644 --- a/src/usart_helpers.h +++ b/src/usart_helpers.h @@ -35,6 +35,7 @@ struct usart_commands{ };
+#ifdef USART_DEBUG
void usart_init(uint32_t usart, uint32_t baudrate);
void usart_printf(const char *str, ...);
void usart_vprintf(const char *str, va_list va);
@@ -42,8 +43,6 @@ void usart_fifo_send(void); void usart_call_cmd(struct usart_commands * commands);
void usart_interrupt(void);
-
-#ifdef USART_DEBUG
#define LOG_PRINTF(format, ...) usart_printf(format, ##__VA_ARGS__);
#define LOG_FLUSH() usart_fifo_send()
#else
|