Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki

This commit is contained in:
Matthias Kovatsch 2012-03-08 00:49:25 +01:00
commit f67fb672eb
41 changed files with 191 additions and 219 deletions

View file

@ -71,10 +71,19 @@ CUSTOM_RULE_C_TO_O = 1
%.o: %.c
$(CC) $(CFLAGS) $< -o $@
define FINALIZE_CYGWIN_DEPENDENCY
sed -e 's/ \([A-Z]\):\\/ \/cygdrive\/\L\1\//' -e 's/\\/\//g' \
<$(@:.o=.P) >$(@:.o=.d); \
rm -f $(@:.o=.P)
endef
CUSTOM_RULE_C_TO_OBJECTDIR_O = 1
$(OBJECTDIR)/%.o: %.c
$(CC) $(CFLAGS) $< -o $@
# @$(FINALIZE_DEPENDENCY)
$(CC) $(CFLAGS) $< --dependencies=m $(@:.o=.P) -o $@
ifeq ($(HOST_OS),Windows)
@$(FINALIZE_CYGWIN_DEPENDENCY)
endif
CUSTOM_RULE_C_TO_CO = 1
%.co: %.c
$(CC) $(CFLAGS) -DAUTOSTART_ENABLE $< -o $@
@ -82,6 +91,7 @@ CUSTOM_RULE_C_TO_CO = 1
AROPTS = -o
else
GCC = 1
CC = msp430-gcc
LD = msp430-gcc
@ -129,8 +139,13 @@ PROJECT_OBJECTFILES += ${addprefix $(OBJECTDIR)/,$(CONTIKI_TARGET_MAIN:.c=.o)}
%.firmware: %.${TARGET}
mv $< $@
ifdef IAR
%.ihex: %.co $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) contiki-$(TARGET).a
$(LD) $(LDFLAGSNO) -Fintel-extended -yn $(TARGET_STARTFILES) ${filter-out %.a,$^} ${filter %.a,$^} $(TARGET_LIBFILES) -o $@
else
%.ihex: %.$(TARGET)
$(OBJCOPY) $^ -O ihex $@
endif
%.mspsim: %.${TARGET}
java -jar ${CONTIKI}/tools/mspsim/mspsim.jar -platform=${TARGET} $<

View file

@ -31,6 +31,7 @@
#include "contiki.h"
#include "dev/button.h"
#include "isr_compat.h"
#define BUTTON_PORT 2
#define BUTTON_PIN 7
@ -57,8 +58,7 @@ button_init(struct process *proc)
P2IE &= ~BV(BUTTON_PIN);
}
interrupt(PORT2_VECTOR)
__button_interrupt(void)
ISR(PORT2, __button_interrupt)
{
static struct timer debouncetimer;

View file

@ -32,6 +32,7 @@
#include "contiki.h"
#include "dev/spi.h"
#include "dev/cc2420.h"
#include "isr_compat.h"
extern volatile uint8_t cc2420_sfd_counter;
extern volatile uint16_t cc2420_sfd_start_time;
@ -39,13 +40,7 @@ extern volatile uint16_t cc2420_sfd_end_time;
/*---------------------------------------------------------------------------*/
/* SFD interrupt for timestamping radio packets */
#ifdef __IAR_SYSTEMS_ICC__
#pragma vector=TIMERB1_VECTOR
__interrupt void
#else
interrupt(TIMERB1_VECTOR)
#endif
cc24240_timerb1_interrupt(void)
ISR(TIMERB1, cc2420_timerb1_interrupt)
{
int tbiv;
ENERGEST_ON(ENERGEST_TYPE_IRQ);

View file

@ -34,6 +34,7 @@
#include "dev/spi.h"
#include "dev/cc2420.h"
#include "isr_compat.h"
#ifdef CC2420_CONF_SFD_TIMESTAMPS
#define CONF_SFD_TIMESTAMPS CC2420_CONF_SFD_TIMESTAMPS
@ -48,14 +49,7 @@
#endif
/*---------------------------------------------------------------------------*/
#ifdef __IAR_SYSTEMS_ICC__
#pragma vector=CC2420_IRQ_VECTOR
__interrupt void
#else
interrupt(CC2420_IRQ_VECTOR)
#endif
cc24240_port1_interrupt(void)
ISR(CC2420_IRQ, cc2420_port1_interrupt)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);
@ -65,7 +59,6 @@ cc24240_port1_interrupt(void)
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
void
cc2420_arch_init(void)

View file

@ -30,6 +30,7 @@
#include "contiki.h"
#include "dev/spi.h"
#include "dev/cc2520.h"
#include "isr_compat.h"
extern volatile uint8_t cc2520_sfd_counter;
extern volatile uint16_t cc2520_sfd_start_time;
@ -37,13 +38,7 @@ extern volatile uint16_t cc2520_sfd_end_time;
/*---------------------------------------------------------------------------*/
/* SFD interrupt for timestamping radio packets */
#ifdef __IAR_SYSTEMS_ICC__
#pragma vector=TIMERB1_VECTOR
__interrupt void
#else
interrupt(TIMERB1_VECTOR)
#endif
cc2520_timerb1_interrupt(void)
ISR(TIMERB1, cc2520_timerb1_interrupt)
{
int tbiv;
ENERGEST_ON(ENERGEST_TYPE_IRQ);

View file

@ -32,6 +32,7 @@
#include "dev/spi.h"
#include "dev/cc2520.h"
#include "isr_compat.h"
#ifdef CC2520_CONF_SFD_TIMESTAMPS
#define CONF_SFD_TIMESTAMPS CC2520_CONF_SFD_TIMESTAMPS
@ -46,13 +47,7 @@
#endif
/*---------------------------------------------------------------------------*/
#ifdef __IAR_SYSTEMS_ICC__
#pragma vector=CC2520_IRQ_VECTOR
__interrupt void
#else
interrupt(CC2520_IRQ_VECTOR)
#endif
cc2520_port1_interrupt(void)
ISR(CC2520_IRQ, cc2520_port1_interrupt)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);

View file

@ -35,6 +35,7 @@
#include "sys/etimer.h"
#include "rtimer-arch.h"
#include "dev/watchdog.h"
#include "isr_compat.h"
#define INTERVAL (RTIMER_ARCH_SECOND / CLOCK_SECOND)
@ -46,13 +47,7 @@ static volatile clock_time_t count = 0;
/* last_tar is used for calculating clock_fine */
static volatile uint16_t last_tar = 0;
/*---------------------------------------------------------------------------*/
#ifdef __IAR_SYSTEMS_ICC__
#pragma vector=TIMERA1_VECTOR
__interrupt void
#else
interrupt(TIMERA1_VECTOR)
#endif
timera1 (void)
ISR(TIMERA1, timera1)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);

View file

@ -44,6 +44,7 @@
#include "sys/rtimer.h"
#include "sys/process.h"
#include "dev/watchdog.h"
#include "isr_compat.h"
#define DEBUG 0
#if DEBUG
@ -54,13 +55,7 @@
#endif
/*---------------------------------------------------------------------------*/
#ifdef __IAR_SYSTEMS_ICC__
#pragma vector=TIMERA0_VECTOR
__interrupt void
#else
interrupt(TIMERA0_VECTOR)
#endif
timera0 (void)
ISR(TIMERA0, timera0)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);

View file

@ -39,6 +39,7 @@
#include "dev/watchdog.h"
#include "sys/ctimer.h"
#include "lib/ringbuf.h"
#include "isr_compat.h"
static int (*uart1_input_handler)(unsigned char c);
static volatile uint8_t rx_in_progress;
@ -236,13 +237,7 @@ uart1_init(unsigned long ubr)
}
/*---------------------------------------------------------------------------*/
#if !RX_WITH_DMA
#ifdef __IAR_SYSTEMS_ICC__
#pragma vector=UART1RX_VECTOR
__interrupt void
#else
interrupt(UART1RX_VECTOR)
#endif
uart1_rx_interrupt(void)
ISR(UART1RX, uart1_rx_interrupt)
{
uint8_t c;
ENERGEST_ON(ENERGEST_TYPE_IRQ);
@ -273,13 +268,7 @@ uart1_rx_interrupt(void)
#endif /* !RX_WITH_DMA */
/*---------------------------------------------------------------------------*/
#if TX_WITH_INTERRUPT
#ifdef __IAR_SYSTEMS_ICC__
#pragma vector=UART1TX_VECTOR
__interrupt void
#else
interrupt(UART1TX_VECTOR)
#endif
uart1_tx_interrupt(void)
ISR(UART1TX, uart1_tx_interrupt)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);

View file

@ -41,6 +41,7 @@
#include "dev/watchdog.h"
#include "lib/ringbuf.h"
#include "dev/leds.h"
#include "isr_compat.h"
static int (*uart0_input_handler)(unsigned char c);
@ -138,14 +139,7 @@ uart0_init(unsigned long ubr)
#endif /* TX_WITH_INTERRUPT */
}
/*---------------------------------------------------------------------------*/
#ifdef __IAR_SYSTEMS_ICC__
#pragma vector=USCIAB0RX_VECTOR
__interrupt void
#else
interrupt(USCIAB0RX_VECTOR)
#endif
uart0_rx_interrupt(void)
ISR(USCIAB0RX, uart0_rx_interrupt)
{
uint8_t c;
@ -165,13 +159,7 @@ uart0_rx_interrupt(void)
}
/*---------------------------------------------------------------------------*/
#if TX_WITH_INTERRUPT
#ifdef __IAR_SYSTEMS_ICC__
#pragma vector=USCIAB0TX_VECTOR
__interrupt void
#else
interrupt(USCIAB0TX_VECTOR)
#endif
uart0_tx_interrupt(void)
ISR(USCIAB0TX, uart0_tx_interrupt)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);
if((IFG2 & UCA0TXIFG)){

View file

@ -37,8 +37,8 @@
#include "sys/energest.h"
#include "dev/uart1.h"
#include "dev/watchdog.h"
#include "lib/ringbuf.h"
#include "isr_compat.h"
static int (*uart1_input_handler)(unsigned char c);
@ -120,8 +120,7 @@ uart1_init(unsigned long ubr)
}
/*---------------------------------------------------------------------------*/
interrupt(USCIAB1RX_VECTOR)
uart1_rx_interrupt(void)
ISR(USCIAB1RX, uart1_rx_interrupt)
{
uint8_t c;
ENERGEST_ON(ENERGEST_TYPE_IRQ);
@ -141,8 +140,7 @@ uart1_rx_interrupt(void)
}
/*---------------------------------------------------------------------------*/
#if TX_WITH_INTERRUPT
interrupt(USCIAB1TX_VECTOR)
uart1_tx_interrupt(void)
ISR(USCIAB1TX, uart1_tx_interrupt)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);
if(IFG2 & UCA0TXIFG) {

View file

@ -35,6 +35,7 @@
#include "sys/etimer.h"
#include "rtimer-arch.h"
#include "dev/watchdog.h"
#include "isr_compat.h"
#define INTERVAL (RTIMER_ARCH_SECOND / CLOCK_SECOND)
@ -46,13 +47,7 @@ static volatile clock_time_t count = 0;
/* last_tar is used for calculating clock_fine, last_ccr might be better? */
static volatile uint16_t 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);

View file

@ -41,6 +41,7 @@
#include "sys/rtimer.h"
#include "sys/process.h"
#include "dev/watchdog.h"
#include "isr_compat.h"
#define DEBUG 0
#if DEBUG
@ -51,13 +52,7 @@
#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);

View file

@ -38,6 +38,7 @@
#include "sys/energest.h"
#include "dev/uart0.h"
#include "dev/watchdog.h"
#include "isr_compat.h"
static int (*uart0_input_handler)(unsigned char c);
@ -98,18 +99,12 @@ uart0_init(unsigned long ubr)
UCA0IE |= UCRXIE; /* Enable UCA0 RX interrupt */
}
/*---------------------------------------------------------------------------*/
#ifdef __IAR_SYSTEMS_ICC__
#pragma vector=USCI_A0_VECTOR
__interrupt void
#else
interrupt(USCI_A0_VECTOR)
#endif
uart0_rx_interrupt(void)
ISR(USCI_A0, uart0_rx_interrupt)
{
uint8_t c;
ENERGEST_ON(ENERGEST_TYPE_IRQ);
if (UCA0IV == 2) {
if(UCA0IV == 2) {
if(UCA0STAT & UCRXERR) {
c = UCA0RXBUF; /* Clear error flags by forcing a dummy read. */
} else {

View file

@ -38,6 +38,7 @@
#include "sys/energest.h"
#include "dev/uart1.h"
#include "dev/watchdog.h"
#include "isr_compat.h"
static int (*uart1_input_handler)(unsigned char c);
@ -103,13 +104,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;

87
cpu/msp430/isr_compat.h Normal file
View file

@ -0,0 +1,87 @@
/*
* Copyright (c) 2005 Steve Underwood
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS `AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
#ifndef _ISR_COMPAT_H_
#define _ISR_COMPAT_H_
/* Cross compiler interrupt service routine compatibility definitions */
/* This code currently allows for:
MSPGCC - the GNU tools for the MSP430
Quadravox AQ430
IAR Version 1 (old syntax)
IAR Versions 2, 3, 4, 5 (new syntax)
Rowley Crossworks
Code Composer Essentials
These macros allow us to define interrupt routines for all
compilers with a common syntax:
ISR(<interrupt>, <routine name>)
{
}
e.g.
ISR(ADC12, adc_service_routine)
{
ADC12CTL0 &= ~ENC;
ADC12CTL0 |= ENC;
}
*/
/* 2012-03-02: minor update to support IAR version 4 and 5 */
/* A tricky #define to stringify _Pragma parameters */
#define __PRAGMA__(x) _Pragma(#x)
#if defined(__GNUC__) && defined(__MSP430__)
/* This is the MSPGCC compiler */
#define ISR(a,b) interrupt(a ## _VECTOR) b(void)
#elif defined(__AQCOMPILER__)
/* This is the Quadravox compiler */
#define ISR(a,b) void _INTERRUPT[a ## _VECTOR] b(void)
#elif defined(__IAR_SYSTEMS_ICC__) && (((__TID__ >> 8) & 0x7f) == 43) && (__VER__ < 200)
/* This is V1.xx of the IAR compiler. */
#define ISR(a,b) interrupt[a ## _VECTOR] void b(void)
#elif defined(__IAR_SYSTEMS_ICC__) && (((__TID__ >> 8) & 0x7f) == 43) && (__VER__ < 600)
/* This is V2.xx, V3.xx, V4.xx, V5.xx of the IAR compiler. */
#define ISR(a,b) \
__PRAGMA__(vector=a ##_VECTOR) \
__interrupt void b(void)
#elif defined(__CROSSWORKS_MSP430)
/* This is the Rowley Crossworks compiler */
#define ISR(a,b) void b __interrupt[a ## _VECTOR](void)
#elif defined(__TI_COMPILER_VERSION__)
/* This is the Code Composer Essentials compiler. */
#define ISR(a,b) __interrupt void b(void); \
a ## _ISR(b) \
__interrupt void b(void)
#else
#error Compiler not recognised.
#endif
#endif

View file

@ -33,6 +33,7 @@
#include "contiki.h"
#include "dev/watchdog.h"
#include "isr_compat.h"
static int counter = 0;
@ -70,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

View file

@ -17,7 +17,7 @@ endif
CONTIKI_TARGET_SOURCEFILES += $(SENSORS) $(ESB) \
contiki-esb-default-init-lowlevel.c \
contiki-esb-default-init-apps.c \
rs232.c rs232-putchar.c fader.c $(CONTIKI_TARGET_MAIN)
rs232.c rs232-putchar.c fader.c
ifdef WITH_CODEPROP
CONTIKI_TARGET_DIRS += ../../apps/codeprop
@ -30,7 +30,7 @@ CFLAGS+=-Os -g
endif
ifdef IAR
CFLAGS+=-e --vla -Ohz --multiplier=16s --core=430 --double=32
CFLAGS += -D__MSP430F149__=1 -e --vla -Ohz --multiplier=16s --core=430 --double=32
CFLAGSNO = --dlib_config "$(IAR_PATH)/LIB/DLIB/dl430fn.h" $(CFLAGSWERROR)
endif
@ -53,6 +53,11 @@ include $(CONTIKI)/platform/$(TARGET)/apps/Makefile.apps
MCU=msp430x149
include $(CONTIKI)/cpu/msp430/Makefile.msp430
ifdef IAR
LDFLAGSNO += -B -xm "$(IAR_PATH)/lib/dlib/dl430fn.r43" -f "$(IAR_PATH)/config/lnk430f149.xcl" -l contiki-$(TARGET).map -s __program_start -D_STACK_SIZE=80 -D_DATA16_HEAP_SIZE=80 -D_DATA20_HEAP_SIZE=80
LDFLAGS += $(LDFLAGSNO) -Felf -yn
endif # IAR
contiki-$(TARGET).a: ${addprefix $(OBJECTDIR)/,symbols.o}
# $(AR) rcf $@ $^

View file

@ -33,7 +33,7 @@
#include "dev/button-sensor.h"
#include "dev/hwconf.h"
#include <signal.h>
#include "isr_compat.h"
const struct sensors_sensor button_sensor;
@ -43,8 +43,7 @@ HWCONF_PIN(BUTTON, 2, 7);
HWCONF_IRQ(BUTTON, 2, 7);
/*---------------------------------------------------------------------------*/
interrupt(PORT2_VECTOR)
irq_p2(void)
ISR(PORT2, irq_p2)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);

View file

@ -78,6 +78,7 @@ Contributors: Thomas Pietsch, Bjoern Lichtblau
#include "dev/leds.h"
#include "dev/beep.h"
#include "isr_compat.h"
PROCESS(ir_process, "IR receiver");
process_event_t ir_event_received;
@ -202,7 +203,7 @@ static void clearDataAvailableBit(void){ recvdata &= 0xEFFF; }
/// Timer B0 interrupt service routine
interrupt(TIMERB1_VECTOR) Timer_B1 (void) {
ISR(TIMERB1, Timer_B1) {
/*P2OUT = (P2OUT & 0xf7) | (8 - (P2OUT & 0x08));*/

View file

@ -34,6 +34,7 @@
#include "lib/sensors.h"
#include "dev/irq.h"
#include "dev/lpm.h"
#include "isr_compat.h"
#define ADC12MCTL_NO(adcno) ((unsigned char *) ADC12MCTL0_)[adcno]
@ -42,8 +43,7 @@ static int (* port1_irq[8])(void);
static unsigned char adcflags;
/*---------------------------------------------------------------------------*/
interrupt(PORT1_VECTOR)
irq_p1(void)
ISR(PORT1, irq_p1)
{
int i;
ENERGEST_ON(ENERGEST_TYPE_IRQ);
@ -58,8 +58,7 @@ interrupt(PORT1_VECTOR)
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
interrupt (ADC_VECTOR)
irq_adc(void)
ISR(ADC, irq_adc)
{
int i;
ENERGEST_ON(ENERGEST_TYPE_IRQ);

View file

@ -47,12 +47,12 @@
#include <string.h>
#include "contiki-esb.h"
#include "isr_compat.h"
static int (* input_handler)(unsigned char) = NULL;
/*---------------------------------------------------------------------------*/
interrupt(UART1RX_VECTOR)
rs232_rx_usart1(void)
ISR(UART1RX, rs232_rx_usart1)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);
/* Check status register for receive errors. - before reading RXBUF since

View file

@ -59,6 +59,7 @@
#include "lib/crc16.h"
#include "net/netstack.h"
#include "net/rime/rimestats.h"
#include "isr_compat.h"
#include <string.h>
@ -385,8 +386,7 @@ tr1001_init(void)
return 1;
}
/*---------------------------------------------------------------------------*/
interrupt (UART0RX_VECTOR)
tr1001_rxhandler(void)
ISR(UART0RX, tr1001_rxhandler)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);
tr1001_default_rxhandler_pt(RXBUF0);

View file

@ -59,6 +59,7 @@
#include "lib/crc16.h"
#include "net/netstack.h"
#include "net/rime/rimestats.h"
#include "isr_compat.h"
#include <string.h>
@ -376,8 +377,7 @@ tr1001_init(void)
return 1;
}
/*---------------------------------------------------------------------------*/
interrupt (UART0RX_VECTOR)
tr1001_rxhandler(void)
ISR(UART0RX, tr1001_rxhandler)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);
tr1001_default_rxhandler_pt(RXBUF0);

View file

@ -60,8 +60,6 @@
#define CCIF
#define CLIF
#define CC_CONF_INLINE inline
#define HAVE_STDINT_H
#include "msp430def.h"

View file

@ -38,8 +38,6 @@
*/
#include "contiki.h"
#include <msp430/adc12.h>
#include "contiki-msb430.h"
void

View file

@ -1,7 +1,7 @@
#ifndef CC1020_INTERNAL_H
#define CC1020_INTERNAL_H
#include <signal.h>
#include "contiki.h"
#define CC1020_MAIN 0x00
#define CC1020_INTERFACE 0x01

View file

@ -41,7 +41,6 @@
#include <stdio.h>
#include <string.h>
#include <signal.h>
#include "contiki.h"
#include "contiki-msb430.h"
@ -52,6 +51,7 @@
#include "net/rime/rimestats.h"
#include "dev/dma.h"
#include "sys/energest.h"
#include "isr_compat.h"
#define DEBUG 0
#if DEBUG
@ -458,7 +458,7 @@ PROCESS_THREAD(cc1020_receiver_process, ev, data)
PROCESS_END();
}
interrupt(UART0RX_VECTOR) cc1020_rxhandler(void)
ISR(UART0RX, cc1020_rxhandler)
{
static signed char syncbs;
static union {

View file

@ -41,10 +41,11 @@
#include "contiki-msb430.h"
#include "dev/cc1020.h"
#include "dev/dma.h"
#include "isr_compat.h"
static void (*callbacks[DMA_LINES])(void);
interrupt(DACDMA_VECTOR) irq_dacdma(void)
ISR(DACDMA, irq_dacdma)
{
if(DMA0CTL & DMAIFG) {
DMA0CTL &= ~(DMAIFG | DMAIE);

View file

@ -51,10 +51,8 @@ Berlin, 2007
* across both blocks are not allowed.
*/
#include <string.h>
#include <signal.h>
#include <stdarg.h>
#include "contiki-conf.h"
#include <msp430/flash.h>
#include "infomem.h"
void

View file

@ -55,6 +55,7 @@ Berlin, 2007
#include <string.h>
#include "dev/msb430-uart1.h"
#include "dev/lpm.h"
#include "isr_compat.h"
#ifndef U1ME
#define U1ME ME2
@ -204,8 +205,7 @@ uart_get_mode(void)
return uart_mode;
}
/*---------------------------------------------------------------------------*/
interrupt(UART1RX_VECTOR)
uart_rx(void)
ISR(UART1RX, uart_rx)
{
uart_handler_t handler = uart_handler[uart_mode];
int c;

View file

@ -59,8 +59,6 @@
#define CCIF
#define CLIF
#define CC_CONF_INLINE inline
#define HAVE_STDINT_H
#include "msp430def.h"

View file

@ -17,12 +17,9 @@ endif
ifdef IAR
CFLAGS += -D__MSP430F1611__=1 -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
CONTIKI_TARGET_SOURCEFILES += $(ARCH) $(UIPDRIVERS)
MCU=msp430x1611
include $(CONTIKI)/cpu/msp430/Makefile.msp430
@ -32,12 +29,9 @@ contiki-$(TARGET).a: ${addprefix $(OBJECTDIR)/,symbols.o}
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
LDFLAGSNO += -B -xm "$(IAR_PATH)/lib/dlib/dl430fn.r43" -f "$(IAR_PATH)/config/lnk430f1611.xcl" -l contiki-$(TARGET).map -s __program_start -D_STACK_SIZE=80 -D_DATA16_HEAP_SIZE=80 -D_DATA20_HEAP_SIZE=80
LDFLAGS += $(LDFLAGSNO) -Felf -yn
endif # IAR
NUMPAR=20
IHEXFILE=tmpimage.ihex

View file

@ -34,6 +34,7 @@
#include "lib/sensors.h"
#include "dev/hwconf.h"
#include "dev/button-sensor.h"
#include "isr_compat.h"
const struct sensors_sensor button_sensor;
@ -44,13 +45,7 @@ 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)
ISR(PORT2, irq_p2)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);

View file

@ -34,19 +34,15 @@ MCU=msp430x5437
include $(CONTIKI)/cpu/msp430/Makefile.msp430
ifdef IAR
LDFLAGS += -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=80 -D_DATA16_HEAP_SIZE=80 -D_DATA20_HEAP_SIZE=80
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=80 -D_DATA16_HEAP_SIZE=80 -D_DATA20_HEAP_SIZE=80
LDFLAGS += $(LDFLAGSNO) -Felf -yn
endif
contiki-$(TARGET).a: ${addprefix $(OBJECTDIR)/,symbols.o}
# $(AR) rcf $@ $^
ifdef IAR
%.hex: %.$(TARGET)
mv $< $@
else
%.hex: %.ihex
mv $< $@
endif
%.upload: %.hex
msp430flasher -n msp430x5437 -e ERASE_MAIN -w $< -v -z [VCC]

View file

@ -31,6 +31,7 @@
#include "lib/sensors.h"
#include "dev/hwconf.h"
#include "dev/button-sensor.h"
#include "isr_compat.h"
const struct sensors_sensor button_sensor;
@ -41,13 +42,7 @@ 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)
ISR(PORT2, irq_p2)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);

View file

@ -1,7 +1,5 @@
# $Id: Makefile.z1,v 1.5 2011/02/26 enricmcalvo Exp $
PROJECT_SOURCEFILES += i2cmaster.c adxl345.c
ifdef GCC
CFLAGS+=-Os -g
endif
@ -13,9 +11,6 @@ LDFLAGS += -Wl,--defsym -Wl,__P1SEL2=0x0041 -Wl,--defsym -Wl,__P5SEL2=0x0045
endif
CLEAN += symbols.c symbols.h
#CFLAGS += -ffunction-sections
#LDFLAGS += -Wl,--gc-sections,--undefined=_reset_vector__,--undefined=InterruptVectors,--undefined=_copy_data_init__,--undefined=_clear_bss_init__,--undefined=_end_of_init__
ARCH=msp430.c leds.c watchdog.c xmem.c \
spi.c cc2420.c cc2420-aes.c cc2420-arch.c cc2420-arch-sfd.c\
@ -39,14 +34,15 @@ CFLAGS += -DMACID=$(nodemac)
endif
CONTIKI_TARGET_SOURCEFILES += $(ARCH) $(UIPDRIVERS)
CONTIKI_TARGET_SOURCEFILES += contiki-z1-platform.c
CONTIKI_TARGET_SOURCEFILES += i2cmaster.c adxl345.c
MCU=msp430x2617
include $(CONTIKI)/cpu/msp430/Makefile.msp430
# Add LDFLAGS after IAR_PATH is set
ifdef IAR
LDFLAGS += -B -xm "$(IAR_PATH)/lib/dlib/dl430xsfn.r43" -f "$(IAR_PATH)/config/lnk430f2617.xcl" -l contiki-$(TARGET).map -Fintel-extended -s __program_start -D_STACK_SIZE=80 -D_DATA16_HEAP_SIZE=80 -D_DATA20_HEAP_SIZE=80
LDFLAGSNO += -B -xm "$(IAR_PATH)/lib/dlib/dl430xsfn.r43" -f "$(IAR_PATH)/config/lnk430f2617.xcl" -l contiki-$(TARGET).map -s __program_start -D_STACK_SIZE=80 -D_DATA16_HEAP_SIZE=80 -D_DATA20_HEAP_SIZE=80
LDFLAGS += $(LDFLAGSNO) -Felf -yn
endif
contiki-$(TARGET).a: ${addprefix $(OBJECTDIR)/,symbols.o}

View file

@ -44,6 +44,7 @@
#include "adxl345.h"
#include "cc2420.h"
#include "i2cmaster.h"
#include "isr_compat.h"
/* Callback pointers when interrupt occurs */
void (*accm_int1_cb)(uint8_t reg);
@ -375,13 +376,8 @@ PROCESS_THREAD(accmeter_process, ev, data) {
#if 1
static struct timer suppressTimer1, suppressTimer2;
#ifdef __IAR_SYSTEMS_ICC__
#pragma vector=PORT1_VECTOR
__interrupt void
#else
interrupt (PORT1_VECTOR)
#endif
port1_isr (void) {
ISR(PORT1, port1_isr)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);
/* ADXL345_IFG.x goes high when interrupt occurs, use to check what interrupted */
if ((ADXL345_IFG & ADXL345_INT1_PIN) && !(ADXL345_IFG & BV(CC2420_FIFOP_PIN))){

View file

@ -35,6 +35,7 @@
#include "lib/sensors.h"
#include "dev/hwconf.h"
#include "dev/button-sensor.h"
#include "isr_compat.h"
const struct sensors_sensor button_sensor;
@ -45,14 +46,7 @@ HWCONF_PIN(BUTTON, 2, 5);
HWCONF_IRQ(BUTTON, 2, 5);
/*---------------------------------------------------------------------------*/
#ifdef __IAR_SYSTEMS_ICC__
#pragma vector=PORT2_VECTOR
__interrupt void
#else
interrupt(PORT2_VECTOR)
#endif
irq_p2(void)
ISR(PORT2, irq_p2)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);

View file

@ -33,6 +33,7 @@
#include "contiki-net.h"
#include "dev/spi.h"
#include "dev/cc2420.h"
#include "isr_compat.h"
#ifndef CONF_SFD_TIMESTAMPS
#define CONF_SFD_TIMESTAMPS 0
@ -45,8 +46,7 @@
/*---------------------------------------------------------------------------*/
#if 0
// this is now handled in the ADXL345 accelerometer code as it uses irq on port1 too.
interrupt(CC2420_IRQ_VECTOR)
cc24240_port1_interrupt(void)
ISR(CC2420_IRQ, cc24240_port1_interrupt)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);
if(cc2420_interrupt()) {

View file

@ -39,6 +39,7 @@
*/
#include "i2cmaster.h"
#include "isr_compat.h"
signed char tx_byte_ctr, rx_byte_ctr;
unsigned char rx_buf[2];
@ -201,13 +202,8 @@ i2c_transmit_n(uint8_t byte_ctr, uint8_t *tx_buf) {
}
/*----------------------------------------------------------------------------*/
#ifdef __IAR_SYSTEMS_ICC__
#pragma vector=USCIAB1TX_VECTOR
__interrupt void
#else
interrupt (USCIAB1TX_VECTOR)
#endif
i2c_tx_interrupt (void) {
ISR(USCIAB1TX, i2c_tx_interrupt)
{
// TX Part
if (UC1IFG & UCB1TXIFG) { // TX int. condition
if (tx_byte_ctr == 0) {
@ -237,18 +233,11 @@ i2c_tx_interrupt (void) {
#endif
}
#ifdef __IAR_SYSTEMS_ICC__
#pragma vector=USCIAB1RX_VECTOR
__interrupt void
#else
interrupt (USCIAB1RX_VECTOR)
#endif
i2c_rx_interrupt(void) {
if (UCB1STAT & UCNACKIFG){
ISR(USCIAB1RX, i2c_rx_interrupt)
{
if(UCB1STAT & UCNACKIFG) {
PRINTFDEBUG("!!! NACK received in RX\n");
UCB1CTL1 |= UCTXSTP;
UCB1STAT &= ~UCNACKIFG;
}
}