From 8c6ebe6f07cb81ab197850c2af4c75fb50e5f1cb Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 17 Jun 2011 22:03:20 +0000 Subject: Fix AVR clock setup; add SPI driver git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3721 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/avr/src/atmega/Make.defs | 4 ++++ nuttx/arch/avr/src/atmega/atmega_lowinit.c | 5 +++++ nuttx/arch/avr/src/atmega/atmega_memorymap.h | 6 ------ nuttx/arch/avr/src/atmega/chip.h | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) (limited to 'nuttx/arch/avr/src/atmega') diff --git a/nuttx/arch/avr/src/atmega/Make.defs b/nuttx/arch/avr/src/atmega/Make.defs index a761b4938..16f0f5a62 100644 --- a/nuttx/arch/avr/src/atmega/Make.defs +++ b/nuttx/arch/avr/src/atmega/Make.defs @@ -54,6 +54,10 @@ ifeq ($(CONFIG_ARCH_STACKDUMP),y) CMN_CSRCS += up_dumpstate.c endif +ifeq ($(CONFIG_AVR_SPI),y) +CMN_CSRCS += up_spi.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 417f4e2eb..5802a22f0 100644 --- a/nuttx/arch/avr/src/atmega/atmega_lowinit.c +++ b/nuttx/arch/avr/src/atmega/atmega_lowinit.c @@ -39,6 +39,7 @@ #include #include +#include #include "atmega_config.h" #include "up_internal.h" @@ -127,6 +128,10 @@ void up_lowinit(void) up_wdtinit(); + /* Set the system clock divider to 1 */ + + clock_prescale_set(clock_div_1); + /* Initialize a console (probably a serial console) */ up_consoleinit(); diff --git a/nuttx/arch/avr/src/atmega/atmega_memorymap.h b/nuttx/arch/avr/src/atmega/atmega_memorymap.h index a509f7657..7b990754c 100644 --- a/nuttx/arch/avr/src/atmega/atmega_memorymap.h +++ b/nuttx/arch/avr/src/atmega/atmega_memorymap.h @@ -46,12 +46,6 @@ * Pre-processor Definitions ************************************************************************************/ -/* Physical memory map */ -# warning "Missing Definitions" - -/* Peripheral Address Map */ -# warning "Missing Definitions" - /************************************************************************************ * Public Types ************************************************************************************/ diff --git a/nuttx/arch/avr/src/atmega/chip.h b/nuttx/arch/avr/src/atmega/chip.h index 7f114a604..0e3f779ab 100644 --- a/nuttx/arch/avr/src/atmega/chip.h +++ b/nuttx/arch/avr/src/atmega/chip.h @@ -48,7 +48,7 @@ /* Define features for supported chip in the ATMEGA family */ -#if 0 +#if 1 #else # error "Unsupported AVR chip" #endif -- cgit v1.2.3