From b780c7bea62c401085e060190329f83f8b2dd460 Mon Sep 17 00:00:00 2001 From: skarg Date: Thu, 3 Jun 2010 19:28:29 +0000 Subject: [PATCH] Added NDEBUG as control for watchdog timer enable. Yes, I know NDEBUG is a debated topic, but I think it fits the use case. --- bacnet-stack/ports/bdk-atxx4-mstp/Makefile | 6 +++--- bacnet-stack/ports/bdk-atxx4-mstp/init.c | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/bacnet-stack/ports/bdk-atxx4-mstp/Makefile b/bacnet-stack/ports/bdk-atxx4-mstp/Makefile index 621c98f9..eee8cfbb 100644 --- a/bacnet-stack/ports/bdk-atxx4-mstp/Makefile +++ b/bacnet-stack/ports/bdk-atxx4-mstp/Makefile @@ -143,15 +143,15 @@ DEFINES = OPTIMIZE_FLAGS = -mcall-prologues OPTIMIZE_FLAGS += -finline-functions-called-once # default is for debugging from AVR Studio -OPTIMIZATION = -Os $(OPTIMIZE_FLAGS) -DEBUGGING = +OPTIMIZATION = -O1 $(OPTIMIZE_FLAGS) +DEBUGGING = -g ifeq (${BUILD},debug) OPTIMIZATION = -O0 DEBUGGING = -g endif ifeq (${BUILD},release) OPTIMIZATION = -Os $(OPTIMIZE_FLAGS) -DEBUGGING = +DEBUGGING = -DNDEBUG endif ## BACnet options diff --git a/bacnet-stack/ports/bdk-atxx4-mstp/init.c b/bacnet-stack/ports/bdk-atxx4-mstp/init.c index 777d2378..afd80ba3 100644 --- a/bacnet-stack/ports/bdk-atxx4-mstp/init.c +++ b/bacnet-stack/ports/bdk-atxx4-mstp/init.c @@ -57,7 +57,10 @@ void init( PORTC = 0; DDRD = 0; PORTD = 0; - /* Configure the watchdog timer - Disabled for testing */ - /* wdt_enable(WDTO_2S); */ + /* Configure the watchdog timer - Disabled for debugging */ +#ifdef NDEBUG + wdt_enable(WDTO_2S); +#else wdt_disable(); +#endif }