fixed Sky platform for IAR compiler
This commit is contained in:
parent
d01df43a0c
commit
95dde73618
17 changed files with 149 additions and 22 deletions
|
@ -14,7 +14,19 @@ ifdef UIP_CONF_IPV6
|
|||
CFLAGS += -DWITH_UIP6=1
|
||||
endif
|
||||
|
||||
CONTIKI_TARGET_SOURCEFILES += $(ARCH) $(UIPDRIVERS) $(CONTIKI_TARGET_MAIN)
|
||||
ifdef GCC
|
||||
CFLAGS+=-Os -g
|
||||
endif
|
||||
|
||||
ifdef IAR
|
||||
CFLAGS+=-e --vla -Ohz --multiplier=16s --core=430 --double=32
|
||||
CFLAGSNO = --dlib_config "$(IAR_PATH)/LIB/DLIB/dl430fn.h" $(CFLAGSWERROR)
|
||||
|
||||
endif
|
||||
|
||||
|
||||
CONTIKI_TARGET_SOURCEFILES += $(ARCH) $(UIPDRIVERS) #$(CONTIKI_TARGET_MAIN)
|
||||
CONTIKI_TARGET_SOURCEFILES += contiki-sky-platform.c
|
||||
|
||||
MCU=msp430x1611
|
||||
include $(CONTIKI)/cpu/msp430/Makefile.msp430
|
||||
|
@ -23,6 +35,14 @@ contiki-$(TARGET).a: ${addprefix $(OBJECTDIR)/,symbols.o}
|
|||
# $(AR) rcf $@ $^
|
||||
|
||||
|
||||
ifdef IAR
|
||||
ifdef ELF
|
||||
LDFLAGS += -B -xm "$(IAR_PATH)/lib/dlib/dl430fn.r43" -f "$(IAR_PATH)/config/lnk430f1611.xcl" -l contiki-$(TARGET).map -Felf -yn -s __program_start -D_STACK_SIZE=80 -D_DATA16_HEAP_SIZE=80 -D_DATA20_HEAP_SIZE=80
|
||||
else
|
||||
LDFLAGS += -B -xm "$(IAR_PATH)/lib/dlib/dl430fn.r43" -f "$(IAR_PATH)/config/lnk430f1611.xcl" -l contiki-$(TARGET).map -Fintel-extended -s __program_start -D_STACK_SIZE=80 -D_DATA16_HEAP_SIZE=80 -D_DATA20_HEAP_SIZE=80
|
||||
endif
|
||||
endif
|
||||
|
||||
NUMPAR=20
|
||||
IHEXFILE=tmpimage.ihex
|
||||
|
||||
|
|
|
@ -56,8 +56,12 @@
|
|||
#include "cfs/cfs.h"
|
||||
#include "cfs/cfs-coffee.h"
|
||||
|
||||
#ifdef __IAR_SYSTEMS_ICC__
|
||||
#include <msp430.h>
|
||||
#else
|
||||
#include <io.h>
|
||||
#include <signal.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
|
||||
#define DEBUG 0
|
||||
|
|
|
@ -31,11 +31,14 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "contiki.h"
|
||||
|
||||
#ifdef __IAR_SYSTEMS_ICC__
|
||||
#include <msp430.h>
|
||||
#else
|
||||
#include <io.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include "contiki.h"
|
||||
#endif
|
||||
|
||||
#include "dev/cc2420.h"
|
||||
#include "dev/ds2411.h"
|
||||
|
|
|
@ -36,9 +36,14 @@
|
|||
* $Revision: 1.11 $
|
||||
*/
|
||||
|
||||
#include "contiki.h"
|
||||
#include "dev/battery-sensor.h"
|
||||
#include "dev/sky-sensors.h"
|
||||
#ifdef __IAR_SYSTEMS_ICC__
|
||||
#include <msp430.h>
|
||||
#else
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
/* Configure ADC12_2 to sample channel 11 (voltage) and use */
|
||||
/* the Vref+ as reference (SREF_1) since it is a stable reference */
|
||||
|
|
|
@ -33,7 +33,12 @@
|
|||
#include "lib/sensors.h"
|
||||
#include "dev/hwconf.h"
|
||||
#include "dev/button-sensor.h"
|
||||
|
||||
#ifdef __IAR_SYSTEMS_ICC__
|
||||
#include <msp430.h>
|
||||
#else
|
||||
#include <signal.h>
|
||||
#endif
|
||||
|
||||
const struct sensors_sensor button_sensor;
|
||||
|
||||
|
@ -44,7 +49,12 @@ HWCONF_PIN(BUTTON, 2, 7);
|
|||
HWCONF_IRQ(BUTTON, 2, 7);
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#ifdef __IAR_SYSTEMS_ICC__
|
||||
#pragma vector=PORT2_VECTOR
|
||||
__interrupt void
|
||||
#else
|
||||
interrupt(PORT2_VECTOR)
|
||||
#endif
|
||||
irq_p2(void)
|
||||
{
|
||||
ENERGEST_ON(ENERGEST_TYPE_IRQ);
|
||||
|
|
|
@ -41,10 +41,14 @@
|
|||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <io.h>
|
||||
|
||||
#include <contiki.h>
|
||||
|
||||
#ifdef __IAR_SYSTEMS_ICC__
|
||||
#include <msp430.h>
|
||||
#else
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#include <dev/spi.h>
|
||||
#include <dev/leds.h>
|
||||
|
||||
|
|
|
@ -36,7 +36,11 @@
|
|||
#include "dev/sky-sensors.h"
|
||||
#include "dev/light-sensor.h"
|
||||
|
||||
#ifdef __IAR_SYSTEMS_ICC__
|
||||
#include <msp430.h>
|
||||
#else
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
/* Photodiode 1 (P64) on INCH_4 */
|
||||
/* Photodiode 2 (P65) on INCH_5 */
|
||||
|
|
|
@ -38,8 +38,13 @@
|
|||
* $Revision: 1.3 $
|
||||
*/
|
||||
#include "contiki.h"
|
||||
#include "lib/sensors.h"
|
||||
|
||||
#ifdef __IAR_SYSTEMS_ICC__
|
||||
#include <msp430.h>
|
||||
#else
|
||||
#include <io.h>
|
||||
#endif
|
||||
#include "lib/sensors.h"
|
||||
|
||||
#define ADC12MCTL_NO(adcno) ((unsigned char *) ADC12MCTL0_)[adcno]
|
||||
|
||||
|
|
|
@ -39,13 +39,18 @@
|
|||
* unwritten data will read as zeros (UNIX style).
|
||||
*/
|
||||
|
||||
|
||||
#include "contiki.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __IAR_SYSTEMS_ICC__
|
||||
#include <msp430.h>
|
||||
#else
|
||||
#include <io.h>
|
||||
#include <signal.h>
|
||||
#endif
|
||||
|
||||
#include "contiki.h"
|
||||
|
||||
#include "dev/spi.h"
|
||||
#include "dev/xmem.h"
|
||||
|
|
|
@ -50,6 +50,21 @@
|
|||
#define PLATFORM_HAS_LEDS 1
|
||||
#define PLATFORM_HAS_BUTTON 1
|
||||
|
||||
#ifdef __IAR_SYSTEMS_ICC__
|
||||
#include <intrinsics.h>
|
||||
#include <in430.h>
|
||||
#define dint() __disable_interrupt()
|
||||
#define eint() __enable_interrupt()
|
||||
#define __MSP430F1611__ 1
|
||||
#define __MSP430__ 1
|
||||
#define CC_CONF_INLINE
|
||||
#define BV(x) (1 << x)
|
||||
#else
|
||||
#define CC_CONF_INLINE inline
|
||||
#define MSP430_MEMCPY_WORKAROUND 1
|
||||
#endif
|
||||
|
||||
|
||||
/* CPU target speed in Hz */
|
||||
#define F_CPU 3900000uL /*2457600uL*/
|
||||
|
||||
|
@ -61,10 +76,7 @@
|
|||
#define CCIF
|
||||
#define CLIF
|
||||
|
||||
#define CC_CONF_INLINE inline
|
||||
|
||||
#define HAVE_STDINT_H
|
||||
#define MSP430_MEMCPY_WORKAROUND 1
|
||||
#include "msp430def.h"
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue