From 8890904aa2c7302a103d7f6f606bbcdb87c54c4d Mon Sep 17 00:00:00 2001 From: joxe Date: Mon, 7 Sep 2009 12:02:58 +0000 Subject: [PATCH] moved radio specifics out of avr Makefile and added some rs232 defs in order to get MicaZ platform working --- cpu/avr/Makefile.avr | 22 ++++------------------ cpu/avr/dev/rs232_atmega128.h | 16 ++++++++++++++++ cpu/avr/rtimer-arch.c | 4 ++-- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/cpu/avr/Makefile.avr b/cpu/avr/Makefile.avr index 009a8c22a..c46a15b8b 100644 --- a/cpu/avr/Makefile.avr +++ b/cpu/avr/Makefile.avr @@ -1,4 +1,4 @@ -# $Id: Makefile.avr,v 1.16 2009/07/26 12:10:38 dak664 Exp $ +# $Id: Makefile.avr,v 1.17 2009/09/07 12:02:58 joxe Exp $ ### Check if we are running under Windows @@ -35,23 +35,6 @@ CONTIKI_TARGET_SOURCEFILES += $(USB) AVR = clock.c mtarch.c eeprom.c flash.c leds-arch.c endif -### The RF230 "bare bones" driver uses the core MAC layer. -### It does NOT work with the Jackdaw USB stick. -### Define RF230BB in the base makefile, or use $make RF230BB=1 ... -ifeq ($(RF230BB),1) -#ifdef RF230BB - CFLAGS += -DRF230BB - #Source for AT86RF230 barebones driver using the contiki core MAC - include $(CONTIKI)/cpu/avr/radio/rf230bb/Makefile.rf230bb -else - # Source for AT86RF230 - include $(CONTIKI)/cpu/avr/radio/rf230/Makefile.rf230 - #Source for Atmel/Cisco 802.15.4'ish MAC - include $(CONTIKI)/cpu/avr/radio/mac/Makefile.mac - #Source for IEEE 802.15.4 manager interface - include $(CONTIKI)/cpu/avr/radio/ieee-manager/Makefile.ieee-manager -endif - #For a coffee file system, the application makefile can define COFFEE_FILES=n #to select the type and COFFEE_ADDRESS=0xaaaaaaaa as the starting byte address. #If only one is define the other will use the (Raven webserver 1284p) defaults @@ -155,6 +138,9 @@ $(OBJECTDIR)/%.o: %.c %.hex: %.out $(OBJCOPY) $^ -O ihex $@ +%.ihex: %.out + $(OBJCOPY) $^ -O ihex $@ + # Add a namelist to the kernel %.out: %.co $(PROJECT_OBJECTFILES) contiki-$(TARGET).a $(CONTIKI)/tools/make-empty-symbols diff --git a/cpu/avr/dev/rs232_atmega128.h b/cpu/avr/dev/rs232_atmega128.h index ac9bb87f7..855274dcc 100644 --- a/cpu/avr/dev/rs232_atmega128.h +++ b/cpu/avr/dev/rs232_atmega128.h @@ -86,6 +86,22 @@ #define USART_BAUD_230400 1 #define USART_BAUD_250000 1 #define USART_BAUD_500000 0 +/* For Micaz the MCU clock rate is 7.3728 MHz*/ +#elif MCU_MHZ == 7 +/* Single speed operation (U2X = 0)*/ +#define USART_BAUD_2400 191 +#define USART_BAUD_4800 95 +#define USART_BAUD_9600 47 +#define USART_BAUD_14400 31 +#define USART_BAUD_19200 23 +#define USART_BAUD_28800 15 +#define USART_BAUD_38400 11 +#define USART_BAUD_57600 7 +#define USART_BAUD_76800 5 +#define USART_BAUD_115200 3 +#define USART_BAUD_230400 1 +#define USART_BAUD_250000 1 +#define USART_BAUD_500000 0 #else #error "Please define the baud rates for your CPU clock: ATmega128 handbook p. \ 195-198 or set the rate in contiki-conf.h" diff --git a/cpu/avr/rtimer-arch.c b/cpu/avr/rtimer-arch.c index 5d6777c85..1bf738b9c 100644 --- a/cpu/avr/rtimer-arch.c +++ b/cpu/avr/rtimer-arch.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: rtimer-arch.c,v 1.4 2008/11/29 15:55:02 c_oflynn Exp $ + * $Id: rtimer-arch.c,v 1.5 2009/09/07 12:02:58 joxe Exp $ */ /** @@ -45,7 +45,7 @@ #include #include -#include "lib/energest.h" +#include "sys/energest.h" #include "sys/rtimer.h" #include "rtimer-arch.h"