summaryrefslogtreecommitdiff
path: root/nuttx/arch/avr/src/atmega
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-06-18 13:22:36 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-06-18 13:22:36 +0000
commitfe368e772ce7195b9f751b78febc236527797fb5 (patch)
tree61aae4ce1f919d103611010ba615ec8952c85768 /nuttx/arch/avr/src/atmega
parent8c6ebe6f07cb81ab197850c2af4c75fb50e5f1cb (diff)
downloadpx4-nuttx-fe368e772ce7195b9f751b78febc236527797fb5.tar.gz
px4-nuttx-fe368e772ce7195b9f751b78febc236527797fb5.tar.bz2
px4-nuttx-fe368e772ce7195b9f751b78febc236527797fb5.zip
Add logic to measure AVR stack usage
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3722 42af7a65-404d-4744-a932-0658087f49c3
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();