Added NDEBUG as control for watchdog timer enable. Yes, I know NDEBUG is a debated topic, but I think it fits the use case.
This commit is contained in:
@@ -143,15 +143,15 @@ DEFINES =
|
|||||||
OPTIMIZE_FLAGS = -mcall-prologues
|
OPTIMIZE_FLAGS = -mcall-prologues
|
||||||
OPTIMIZE_FLAGS += -finline-functions-called-once
|
OPTIMIZE_FLAGS += -finline-functions-called-once
|
||||||
# default is for debugging from AVR Studio
|
# default is for debugging from AVR Studio
|
||||||
OPTIMIZATION = -Os $(OPTIMIZE_FLAGS)
|
OPTIMIZATION = -O1 $(OPTIMIZE_FLAGS)
|
||||||
DEBUGGING =
|
DEBUGGING = -g
|
||||||
ifeq (${BUILD},debug)
|
ifeq (${BUILD},debug)
|
||||||
OPTIMIZATION = -O0
|
OPTIMIZATION = -O0
|
||||||
DEBUGGING = -g
|
DEBUGGING = -g
|
||||||
endif
|
endif
|
||||||
ifeq (${BUILD},release)
|
ifeq (${BUILD},release)
|
||||||
OPTIMIZATION = -Os $(OPTIMIZE_FLAGS)
|
OPTIMIZATION = -Os $(OPTIMIZE_FLAGS)
|
||||||
DEBUGGING =
|
DEBUGGING = -DNDEBUG
|
||||||
endif
|
endif
|
||||||
|
|
||||||
## BACnet options
|
## BACnet options
|
||||||
|
|||||||
@@ -57,7 +57,10 @@ void init(
|
|||||||
PORTC = 0;
|
PORTC = 0;
|
||||||
DDRD = 0;
|
DDRD = 0;
|
||||||
PORTD = 0;
|
PORTD = 0;
|
||||||
/* Configure the watchdog timer - Disabled for testing */
|
/* Configure the watchdog timer - Disabled for debugging */
|
||||||
/* wdt_enable(WDTO_2S); */
|
#ifdef NDEBUG
|
||||||
|
wdt_enable(WDTO_2S);
|
||||||
|
#else
|
||||||
wdt_disable();
|
wdt_disable();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user