Improved support for the IAR compiler.
io and signal have been moved into contiki include file.
This commit is contained in:
parent
f67fb672eb
commit
c2e07c9798
13 changed files with 17 additions and 144 deletions
|
@ -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]
|
||||
|
|
|
@ -31,19 +31,12 @@
|
|||
|
||||
|
||||
#include "contiki.h"
|
||||
|
||||
#ifdef __IAR_SYSTEMS_ICC__
|
||||
#include <msp430.h>
|
||||
#else
|
||||
#include <io.h>
|
||||
#include <signal.h>
|
||||
#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);
|
||||
|
||||
|
|
|
@ -32,18 +32,11 @@
|
|||
*/
|
||||
|
||||
#include "contiki-conf.h"
|
||||
|
||||
#ifdef __IAR_SYSTEMS_ICC__
|
||||
#include <msp430.h>
|
||||
#else
|
||||
#include <io.h>
|
||||
#include <signal.h>
|
||||
#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);
|
||||
|
||||
|
|
|
@ -30,13 +30,6 @@
|
|||
*/
|
||||
|
||||
#include "contiki.h"
|
||||
#ifdef __IAR_SYSTEMS_ICC__
|
||||
#include <msp430.h>
|
||||
#else
|
||||
#include <io.h>
|
||||
#include <signal.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
|
|
|
@ -36,13 +36,6 @@
|
|||
*/
|
||||
|
||||
#include "contiki.h"
|
||||
#ifdef __IAR_SYSTEMS_ICC__
|
||||
#include <msp430.h>
|
||||
#else
|
||||
#include <io.h>
|
||||
#include <signal.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "dev/flash.h"
|
||||
|
|
|
@ -35,11 +35,6 @@
|
|||
******************************************************************************/
|
||||
|
||||
#include "contiki-conf.h"
|
||||
#ifdef __IAR_SYSTEMS_ICC__
|
||||
#include <msp430.h>
|
||||
#else
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#include "hal_MSP-EXP430F5438.h"
|
||||
#include "hal_lcd_fonts.h"
|
||||
|
|
|
@ -42,12 +42,6 @@
|
|||
#include "contiki-conf.h"
|
||||
#include "dev/leds.h"
|
||||
|
||||
#ifdef __IAR_SYSTEMS_ICC__
|
||||
#include <msp430.h>
|
||||
#else
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
/* LED ports */
|
||||
#define LEDS_CONF_RED 0x01
|
||||
#define LEDS_CONF_GREEN 0x02
|
||||
|
|
|
@ -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 <msp430.h>
|
||||
#else
|
||||
#include <io.h>
|
||||
#include <signal.h>
|
||||
#endif
|
||||
#include "dev/watchdog.h"
|
||||
#include "dev/leds.h"
|
||||
#include "net/uip.h"
|
||||
|
|
|
@ -44,19 +44,6 @@
|
|||
* changeable!
|
||||
*/
|
||||
#define TYNDALL 1
|
||||
/* Test for IAR compiler */
|
||||
#ifdef __IAR_SYSTEMS_ICC__
|
||||
#include <intrinsics.h>
|
||||
#include <in430.h>
|
||||
#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
|
||||
|
|
|
@ -39,17 +39,11 @@
|
|||
*/
|
||||
|
||||
#include "contiki.h"
|
||||
#ifdef __IAR_SYSTEMS_ICC__
|
||||
#include <msp430.h>
|
||||
#else
|
||||
#include <io.h>
|
||||
#include <signal.h>
|
||||
#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();
|
||||
|
|
|
@ -30,17 +30,12 @@
|
|||
*/
|
||||
|
||||
#include "contiki-conf.h"
|
||||
#ifdef __IAR_SYSTEMS_ICC__
|
||||
#include <msp430.h>
|
||||
#else
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This is SPI initialization code for the MSP430X architecture.
|
||||
*
|
||||
*/
|
||||
unsigned char spi_busy = 0;
|
||||
/* unsigned char spi_busy = 0; */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* Initialize SPI bus.
|
||||
|
|
|
@ -36,13 +36,6 @@
|
|||
*/
|
||||
|
||||
#include "contiki.h"
|
||||
#ifdef __IAR_SYSTEMS_ICC__
|
||||
#include <msp430.h>
|
||||
#else
|
||||
#include <io.h>
|
||||
#include <signal.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#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;
|
||||
|
||||
|
|
|
@ -32,13 +32,8 @@
|
|||
*/
|
||||
|
||||
#include "contiki-conf.h"
|
||||
#ifdef __IAR_SYSTEMS_ICC__
|
||||
#include <msp430.h>
|
||||
#else
|
||||
#include <io.h>
|
||||
#include <signal.h>
|
||||
#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
|
||||
|
|
Loading…
Reference in a new issue