diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-06-15 20:43:32 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-06-15 20:43:32 +0000 |
commit | 6883da2c97ffc7f3ee0d96d3f977fb7c1ecd1c9c (patch) | |
tree | 4531f9dbd086b423486fd28773e8fe84519ecc13 | |
parent | 3831c92f094ef1e0f59d0bc8c11a7119f8835a7a (diff) | |
download | px4-nuttx-6883da2c97ffc7f3ee0d96d3f977fb7c1ecd1c9c.tar.gz px4-nuttx-6883da2c97ffc7f3ee0d96d3f977fb7c1ecd1c9c.tar.bz2 px4-nuttx-6883da2c97ffc7f3ee0d96d3f977fb7c1ecd1c9c.zip |
AVR: Need to use rjmp, not jmp, in vector table
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3707 42af7a65-404d-4744-a932-0658087f49c3
-rwxr-xr-x | nuttx/arch/avr/src/at90usb/at90usb_head.S | 2 | ||||
-rwxr-xr-x | nuttx/arch/avr/src/atmega/atmega_head.S | 2 | ||||
-rw-r--r-- | nuttx/arch/avr/src/atmega/atmega_lowinit.c | 43 | ||||
-rw-r--r-- | nuttx/configs/amber/README.txt | 17 |
4 files changed, 61 insertions, 3 deletions
diff --git a/nuttx/arch/avr/src/at90usb/at90usb_head.S b/nuttx/arch/avr/src/at90usb/at90usb_head.S index a9ec75700..e5b729a23 100755 --- a/nuttx/arch/avr/src/at90usb/at90usb_head.S +++ b/nuttx/arch/avr/src/at90usb/at90usb_head.S @@ -119,7 +119,7 @@ ****************************************************************************/ .macro vector name - jmp \name + rjmp \name .endm /**************************************************************************** diff --git a/nuttx/arch/avr/src/atmega/atmega_head.S b/nuttx/arch/avr/src/atmega/atmega_head.S index cc3027658..0fcdf6c28 100755 --- a/nuttx/arch/avr/src/atmega/atmega_head.S +++ b/nuttx/arch/avr/src/atmega/atmega_head.S @@ -116,7 +116,7 @@ ****************************************************************************/ .macro vector name - jmp \name + rjmp \name .endm /**************************************************************************** diff --git a/nuttx/arch/avr/src/atmega/atmega_lowinit.c b/nuttx/arch/avr/src/atmega/atmega_lowinit.c index 9361e26b0..4720161bf 100644 --- a/nuttx/arch/avr/src/atmega/atmega_lowinit.c +++ b/nuttx/arch/avr/src/atmega/atmega_lowinit.c @@ -47,6 +47,28 @@ * Private Definitions **************************************************************************/ +#if defined(CONFIG_WDTO_15MS) +# define WDTO_VALUE WDTO_15MS +#elif defined(CONFIG_WDTO_30MS) +# define WDTO_VALUE WDTO_30MS +#elif defined(CONFIG_WDTO_60MS) +# define WDTO_VALUE WDTO_60MS +#elif defined(CONFIG_WDTO_120MS) +# define WDTO_VALUE WDTO_120MS +#elif defined(CONFIG_WDTO_1250MS) +# define WDTO_VALUE WDTO_250MS +#elif defined(CONFIG_WDTO_500MS) +# define WDTO_VALUE WDTO_500MS +#elif defined(CONFIG_WDTO_1S) +# define WDTO_VALUE WDTO_1S +#elif defined(CONFIG_WDTO_2S) +# define WDTO_VALUE WDTO_2S +#elif defined(CONFIG_WDTO_4S) +# define WDTO_VALUE WDTO_4S +#else /* if defined(CONFIG_WDTO_8S) */ +# define WDTO_VALUE WDTO_8S +#endif + /************************************************************************** * Private Types **************************************************************************/ @@ -68,6 +90,23 @@ **************************************************************************/ /************************************************************************** + * Name: up_wdtinit + * + * Description: + * Initialize the watchdog per the NuttX configuration. + * + **************************************************************************/ + +static inline void up_wdtinit(void) +{ +#ifndef CONFIG_AVR_WDT + wdt_disable(); +#else + wdt_enable(WDTO_VALUE); +#endif +} + +/************************************************************************** * Public Functions **************************************************************************/ @@ -83,6 +122,10 @@ void up_lowinit(void) { + /* Initialize the watchdog timer */ + + up_wdtinit(); + /* Initialize a console (probably a serial console) */ up_consoleinit(); diff --git a/nuttx/configs/amber/README.txt b/nuttx/configs/amber/README.txt index 4b85a27bb..391f3e593 100644 --- a/nuttx/configs/amber/README.txt +++ b/nuttx/configs/amber/README.txt @@ -446,6 +446,7 @@ Amber Web Server Configuration Options CONFIG_AVR_INT5=n CONFIG_AVR_INT6=n CONFIG_AVR_INT7=n + CONFIG_AVR_WDT=n CONFIG_AVR_TIMER0=n CONFIG_AVR_TIMER1=n CONFIG_AVR_TIMER2=n @@ -457,7 +458,21 @@ Amber Web Server Configuration Options CONFIG_AVR_ANACOMP=n CONFIG_AVR_TWI=n - ATMEGA specific device driver settings + If the watchdog is enabled, this specifies the initial timeout. Default + is maximum supported value. + + CONFIG_WDTO_15MS + CONFIG_WDTO_30MS + CONFIG_WDTO_60MS + CONFIG_WDTO_120MS + CONFIG_WDTO_1250MS + CONFIG_WDTO_500MS + CONFIG_WDTO_1S + CONFIG_WDTO_2S + CONFIG_WDTO_4S + CONFIG_WDTO_8S + + ATMEGA specific device driver settings CONFIG_USARTn_SERIAL_CONSOLE - selects the USARTn for the console and ttys0 (default is the USART0). |