summaryrefslogtreecommitdiff
path: root/nuttx/arch/avr/src/atmega
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/arch/avr/src/atmega')
-rw-r--r--nuttx/arch/avr/src/atmega/Make.defs4
-rw-r--r--nuttx/arch/avr/src/atmega/atmega_lowinit.c12
2 files changed, 11 insertions, 5 deletions
diff --git a/nuttx/arch/avr/src/atmega/Make.defs b/nuttx/arch/avr/src/atmega/Make.defs
index 16f0f5a62..47683fcd0 100644
--- a/nuttx/arch/avr/src/atmega/Make.defs
+++ b/nuttx/arch/avr/src/atmega/Make.defs
@@ -58,6 +58,10 @@ ifeq ($(CONFIG_AVR_SPI),y)
CMN_CSRCS += up_spi.c
endif
+ifeq ($(CONFIG_DEBUG_STACK),y)
+CMN_CSRCS += up_checkstack.c
+endif
+
# Required ATMEGA files
CHIP_ASRCS = atmega_exceptions.S
diff --git a/nuttx/arch/avr/src/atmega/atmega_lowinit.c b/nuttx/arch/avr/src/atmega/atmega_lowinit.c
index 5802a22f0..bb0a4d512 100644
--- a/nuttx/arch/avr/src/atmega/atmega_lowinit.c
+++ b/nuttx/arch/avr/src/atmega/atmega_lowinit.c
@@ -101,9 +101,7 @@
static inline void up_wdtinit(void)
{
-#ifndef CONFIG_AVR_WDT
- wdt_disable();
-#else
+#ifdef CONFIG_AVR_WDT
wdt_enable(WDTO_VALUE);
#endif
}
@@ -124,14 +122,18 @@ static inline void up_wdtinit(void)
void up_lowinit(void)
{
- /* Initialize the watchdog timer */
+ /* Disable the watchdog timer */
- up_wdtinit();
+ wdt_disable();
/* Set the system clock divider to 1 */
clock_prescale_set(clock_div_1);
+ /* Initialize the watchdog timer */
+
+ up_wdtinit();
+
/* Initialize a console (probably a serial console) */
up_consoleinit();