diff --git a/platform/exp5438/Makefile.exp5438 b/platform/exp5438/Makefile.exp5438 index 3f4d54820..a3e57fc90 100644 --- a/platform/exp5438/Makefile.exp5438 +++ b/platform/exp5438/Makefile.exp5438 @@ -1,19 +1,8 @@ # $Id: Makefile.z1,v 1.4 2010/11/07 08:40:24 enricmcalvo Exp $ # msp430flasher -n msp430x5437 -w "Firmware.txt" -v -z [VCC] -ifndef IAR -GCC=1 -endif - -ifdef GCC -CFLAGS+=-Os -g -else -IAR=1 -endif - ifdef IAR -CFLAGS+=-e --vla -Ohz --multiplier=32 --multiplier_location=4C0 --hw_workaround=CPU40 --core=430X --data_model small --double=32 -D__MSP430F5438A__ -CFLAGS += --diag_suppress=Pa050 +CFLAGS+=-e --vla -Ohz --multiplier=32 --multiplier_location=4C0 --hw_workaround=CPU40 --core=430X --data_model small --double=32 -D__MSP430F5438A__=1 #CFLAGS+=--no_cse --no_unroll --no_inline --no_code_motion --no_tbaa --debug -D__MSP430F5438A__ -e --double=32 --dlib_config 'C:\Program Files (x86)\IAR Systems\Embedded Workbench 6.0 Evaluation\430\LIB\DLIB\dl430xsfn.h' --core=430X --data_model=small -Ol --multiplier=32 --multiplier_location=4C0 --hw_workaround=CPU40 endif @@ -43,7 +32,7 @@ help: @echo make help - shows this help @echo make TARGET=exp5438 savetarget - stores selection of target to avoid using TARGET= on every make invokation @echo make program.upload - compiles and uploads program to connected board - @echo make program.upload GCC=1 - uses the mspgcc compiler instead of IAR + @echo make program.upload IAR=1 - uses the IAR compiler instead of mspgcc @echo make program.upload NODEID=x - uploads with node_id set to x CONTIKI_TARGET_DIRS = . dev apps net @@ -70,19 +59,12 @@ contiki-$(TARGET).a: ${addprefix $(OBJECTDIR)/,symbols.o} ifdef IAR STACKSIZE=300 -LDFLAGS_ELF=-B -xm "$(IAR_PATH)/lib/dlib/dl430xsfn.r43" -f "$(IAR_PATH)/config/lnk430f5437.xcl" -l contiki-$(TARGET).map -Felf -yn -s __program_start -D_STACK_SIZE=$(STACKSIZE) -D_DATA16_HEAP_SIZE=$(STACKSIZE) -D_DATA20_HEAP_SIZE=$(STACKSIZE) +LDFLAGSNO += -B -xm "$(IAR_PATH)/lib/dlib/dl430xsfn.r43" -f "$(IAR_PATH)/config/lnk430f5437.xcl" -l contiki-$(TARGET).map -s __program_start -D_STACK_SIZE=$(STACKSIZE) -D_DATA16_HEAP_SIZE=$(STACKSIZE) -D_DATA20_HEAP_SIZE=$(STACKSIZE) +LDFLAGS += $(LDFLAGSNO) -Felf -yn +endif -LDFLAGS_HEX=-B -xm "$(IAR_PATH)/lib/dlib/dl430xsfn.r43" -f "$(IAR_PATH)/config/lnk430f5437.xcl" -l contiki-$(TARGET).map -Fintel-extended -s __program_start -D_STACK_SIZE=$(STACKSIZE) -D_DATA16_HEAP_SIZE=$(STACKSIZE) -D_DATA20_HEAP_SIZE=$(STACKSIZE) - -LDFLAGS+=$(LDFLAGS_ELF) - -%.hex: %.co $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) contiki-$(TARGET).a - $(LD) $(LDFLAGS_HEX) $(TARGET_STARTFILES) ${filter-out %.a,$^} ${filter %.a,$^} $(TARGET_LIBFILES) -o $@ - -else %.hex: %.ihex mv $< $@ -endif %.upload: %.hex msp430flasher -n msp430x5438a -e ERASE_MAIN -w $< -v -z [VCC] diff --git a/platform/exp5438/cc2420-arch.c b/platform/exp5438/cc2420-arch.c index 090dd1611..044e894dd 100644 --- a/platform/exp5438/cc2420-arch.c +++ b/platform/exp5438/cc2420-arch.c @@ -31,19 +31,12 @@ #include "contiki.h" - -#ifdef __IAR_SYSTEMS_ICC__ -#include -#else -#include -#include -#endif - #include "contiki-net.h" #include "dev/spi.h" #include "dev/cc2420.h" #include "dev/leds.h" +#include "isr_compat.h" #ifndef CONF_SFD_TIMESTAMPS #define CONF_SFD_TIMESTAMPS 0 @@ -54,13 +47,7 @@ #endif /*---------------------------------------------------------------------------*/ -#ifdef __IAR_SYSTEMS_ICC__ -#pragma vector=CC2420_IRQ_VECTOR -__interrupt void -#else -interrupt(CC2420_IRQ_VECTOR) -#endif -cc24240_fifop_interrupt(void) +ISR(CC2420_IRQ, cc24240_fifop_interrupt) { ENERGEST_ON(ENERGEST_TYPE_IRQ); diff --git a/platform/exp5438/clock.c b/platform/exp5438/clock.c index a7a419380..0b0973c97 100644 --- a/platform/exp5438/clock.c +++ b/platform/exp5438/clock.c @@ -32,18 +32,11 @@ */ #include "contiki-conf.h" - -#ifdef __IAR_SYSTEMS_ICC__ -#include -#else -#include -#include -#endif - #include "sys/energest.h" #include "sys/clock.h" #include "sys/etimer.h" #include "rtimer-arch.h" +#include "isr_compat.h" #include "dev/leds.h" @@ -57,13 +50,7 @@ static volatile clock_time_t count = 0; /* last_tar is used for calculating clock_fine, last_ccr might be better? */ static unsigned short last_tar = 0; /*---------------------------------------------------------------------------*/ -#ifdef __IAR_SYSTEMS_ICC__ -#pragma vector=TIMER1_A1_VECTOR -__interrupt void -#else -interrupt(TIMER1_A1_VECTOR) -#endif -timera1 (void) +ISR(TIMER1_A1, timera1) { ENERGEST_ON(ENERGEST_TYPE_IRQ); diff --git a/platform/exp5438/contiki-exp5438-main.c b/platform/exp5438/contiki-exp5438-main.c index 92bb570a0..f411ae697 100644 --- a/platform/exp5438/contiki-exp5438-main.c +++ b/platform/exp5438/contiki-exp5438-main.c @@ -30,13 +30,6 @@ */ #include "contiki.h" -#ifdef __IAR_SYSTEMS_ICC__ -#include -#else -#include -#include -#endif - #include #include #include diff --git a/platform/exp5438/flash.c b/platform/exp5438/flash.c index fe6922734..6f9ca6da6 100644 --- a/platform/exp5438/flash.c +++ b/platform/exp5438/flash.c @@ -36,13 +36,6 @@ */ #include "contiki.h" -#ifdef __IAR_SYSTEMS_ICC__ -#include -#else -#include -#include -#endif - #include #include "dev/flash.h" diff --git a/platform/exp5438/hal_lcd.c b/platform/exp5438/hal_lcd.c index 14163f25f..e2475010f 100644 --- a/platform/exp5438/hal_lcd.c +++ b/platform/exp5438/hal_lcd.c @@ -35,11 +35,6 @@ ******************************************************************************/ #include "contiki-conf.h" -#ifdef __IAR_SYSTEMS_ICC__ -#include -#else -#include -#endif #include "hal_MSP-EXP430F5438.h" #include "hal_lcd_fonts.h" diff --git a/platform/exp5438/leds-arch.c b/platform/exp5438/leds-arch.c index c48f0c376..63cd53262 100644 --- a/platform/exp5438/leds-arch.c +++ b/platform/exp5438/leds-arch.c @@ -42,12 +42,6 @@ #include "contiki-conf.h" #include "dev/leds.h" -#ifdef __IAR_SYSTEMS_ICC__ -#include -#else -#include -#endif - /* LED ports */ #define LEDS_CONF_RED 0x01 #define LEDS_CONF_GREEN 0x02 diff --git a/platform/exp5438/msp430.c b/platform/exp5438/msp430.c index c12b6b24d..9c91aa6c2 100644 --- a/platform/exp5438/msp430.c +++ b/platform/exp5438/msp430.c @@ -31,12 +31,6 @@ * @(#)$Id: msp430.c,v 1.1 2010/08/24 16:26:38 joxe Exp $ */ #include "contiki.h" -#ifdef __IAR_SYSTEMS_ICC__ -#include -#else -#include -#include -#endif #include "dev/watchdog.h" #include "dev/leds.h" #include "net/uip.h" diff --git a/platform/exp5438/platform-conf.h b/platform/exp5438/platform-conf.h index f28c7d1ca..5d853a686 100644 --- a/platform/exp5438/platform-conf.h +++ b/platform/exp5438/platform-conf.h @@ -44,19 +44,6 @@ * changeable! */ #define TYNDALL 1 -/* Test for IAR compiler */ -#ifdef __IAR_SYSTEMS_ICC__ -#include -#include -#define dint() __disable_interrupt() -#define eint() __enable_interrupt() -#define __MSP430F5437__ 1 -#define __MSP430__ 1 -#define CC_CONF_INLINE -#define BV(x) (1 << x) -#else -#define CC_CONF_INLINE inline -#endif /* CPU target speed in Hz */ #define F_CPU 8000000uL // 8MHz by default diff --git a/platform/exp5438/rtimer-arch.c b/platform/exp5438/rtimer-arch.c index 7a1e327d7..24867a9f2 100644 --- a/platform/exp5438/rtimer-arch.c +++ b/platform/exp5438/rtimer-arch.c @@ -39,17 +39,11 @@ */ #include "contiki.h" -#ifdef __IAR_SYSTEMS_ICC__ -#include -#else -#include -#include -#endif - #include "sys/energest.h" #include "sys/rtimer.h" #include "sys/process.h" #include "dev/watchdog.h" +#include "isr_compat.h" #define DEBUG 0 #if DEBUG @@ -60,13 +54,8 @@ #endif /*---------------------------------------------------------------------------*/ -#ifdef __IAR_SYSTEMS_ICC__ -#pragma vector=TIMER1_A0_VECTOR -__interrupt void -#else -interrupt(TIMER1_A0_VECTOR) -#endif - timera0 (void) { +ISR(TIMER1_A0, timera0) +{ ENERGEST_ON(ENERGEST_TYPE_IRQ); watchdog_start(); diff --git a/platform/exp5438/spix.c b/platform/exp5438/spix.c index 2f511e650..478931775 100644 --- a/platform/exp5438/spix.c +++ b/platform/exp5438/spix.c @@ -30,17 +30,12 @@ */ #include "contiki-conf.h" -#ifdef __IAR_SYSTEMS_ICC__ -#include -#else -#include -#endif /* * This is SPI initialization code for the MSP430X architecture. * */ -unsigned char spi_busy = 0; +/* unsigned char spi_busy = 0; */ /*---------------------------------------------------------------------------*/ /* * Initialize SPI bus. diff --git a/platform/exp5438/uart1x.c b/platform/exp5438/uart1x.c index 7d0c08977..3c1b41b99 100644 --- a/platform/exp5438/uart1x.c +++ b/platform/exp5438/uart1x.c @@ -36,13 +36,6 @@ */ #include "contiki.h" -#ifdef __IAR_SYSTEMS_ICC__ -#include -#else -#include -#include -#endif - #include #include "sys/energest.h" @@ -50,6 +43,7 @@ #include "dev/watchdog.h" #include "lib/ringbuf.h" #include "dev/leds.h" +#include "isr_compat.h" static int (*uart1_input_handler)(unsigned char c); @@ -114,13 +108,7 @@ uart1_init(unsigned long ubr) UCA1IE |= UCRXIE; /* Enable UCA1 RX interrupt */ } /*---------------------------------------------------------------------------*/ -#ifdef __IAR_SYSTEMS_ICC__ -#pragma vector=USCI_A1_VECTOR -__interrupt void -#else -interrupt(USCI_A1_VECTOR) -#endif -uart1_rx_interrupt(void) +ISR(USCI_A1, uart1_rx_interrupt) { uint8_t c; diff --git a/platform/exp5438/watchdog.c b/platform/exp5438/watchdog.c index fc0dbef47..4a5b222d7 100644 --- a/platform/exp5438/watchdog.c +++ b/platform/exp5438/watchdog.c @@ -32,13 +32,8 @@ */ #include "contiki-conf.h" -#ifdef __IAR_SYSTEMS_ICC__ -#include -#else -#include -#include -#endif #include "dev/watchdog.h" +#include "isr_compat.h" static int counter = 0; @@ -76,13 +71,7 @@ printstring(char *s) #endif /* CONTIKI_TARGET_SKY */ #endif /* PRINT_STACK_ON_REBOOT */ /*---------------------------------------------------------------------------*/ -#ifdef __IAR_SYSTEMS_ICC__ -#pragma vector=WDT_VECTOR -__interrupt void -#else -interrupt(WDT_VECTOR) -#endif -watchdog_interrupt(void) +ISR(WDT, watchdog_interrupt) { #ifdef CONTIKI_TARGET_SKY #if PRINT_STACK_ON_REBOOT