diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-06-18 13:22:36 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-06-18 13:22:36 +0000 |
commit | fe368e772ce7195b9f751b78febc236527797fb5 (patch) | |
tree | 61aae4ce1f919d103611010ba615ec8952c85768 /nuttx/arch/avr/src/at90usb | |
parent | 8c6ebe6f07cb81ab197850c2af4c75fb50e5f1cb (diff) | |
download | px4-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/at90usb')
-rw-r--r-- | nuttx/arch/avr/src/at90usb/Make.defs | 4 | ||||
-rwxr-xr-x | nuttx/arch/avr/src/at90usb/at90usb_exceptions.S | 2 | ||||
-rw-r--r-- | nuttx/arch/avr/src/at90usb/at90usb_lowinit.c | 12 |
3 files changed, 12 insertions, 6 deletions
diff --git a/nuttx/arch/avr/src/at90usb/Make.defs b/nuttx/arch/avr/src/at90usb/Make.defs index 706eca544..7a353dbf4 100644 --- a/nuttx/arch/avr/src/at90usb/Make.defs +++ b/nuttx/arch/avr/src/at90usb/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 AT90USB files CHIP_ASRCS = at90usb_exceptions.S diff --git a/nuttx/arch/avr/src/at90usb/at90usb_exceptions.S b/nuttx/arch/avr/src/at90usb/at90usb_exceptions.S index 44b607033..79eda5f18 100755 --- a/nuttx/arch/avr/src/at90usb/at90usb_exceptions.S +++ b/nuttx/arch/avr/src/at90usb/at90usb_exceptions.S @@ -148,7 +148,7 @@ excpt_common: breq .Lnoswitch /* A context switch has occurred, jump to up_fullcontextrestore with r24, r25 - * equal to the address of the new register save ared. + * equal to the address of the new register save area. */ jmp up_fullcontextrestore diff --git a/nuttx/arch/avr/src/at90usb/at90usb_lowinit.c b/nuttx/arch/avr/src/at90usb/at90usb_lowinit.c index e446fcf13..f7a1b921e 100644 --- a/nuttx/arch/avr/src/at90usb/at90usb_lowinit.c +++ b/nuttx/arch/avr/src/at90usb/at90usb_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(); |