]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Reverting back to decentralized handling of interrupts on the msp430. Centralizing...
authorklueska <klueska>
Thu, 15 May 2008 23:57:13 +0000 (23:57 +0000)
committerklueska <klueska>
Thu, 15 May 2008 23:57:13 +0000 (23:57 +0000)
16 files changed:
tos/chips/msp430/adc12/HplAdc12P.nc
tos/chips/msp430/adc12/Msp430Adc12P.nc
tos/chips/msp430/dma/HplMsp430DmaC.nc
tos/chips/msp430/dma/HplMsp430DmaP.nc
tos/chips/msp430/pins/HplMsp430InterruptC.nc
tos/chips/msp430/pins/HplMsp430InterruptNMIC.nc
tos/chips/msp430/pins/HplMsp430InterruptNMIP.nc
tos/chips/msp430/pins/HplMsp430InterruptP.nc
tos/chips/msp430/pins/HplMsp430InterruptSig.nc [deleted file]
tos/chips/msp430/pins/HplMsp430InterruptSigP.nc [deleted file]
tos/chips/msp430/timer/Msp430TimerC.nc
tos/chips/msp430/timer/Msp430TimerCommonP.nc
tos/chips/msp430/usart/HplMsp430Usart0C.nc
tos/chips/msp430/usart/HplMsp430Usart0P.nc
tos/chips/msp430/usart/HplMsp430Usart1C.nc
tos/chips/msp430/usart/HplMsp430Usart1P.nc

index 6243739d775ca7628424a3a20dbafa77e7b5596e..aaee9ce507e61846f7c65072b5226979c6a46382 100644 (file)
@@ -44,7 +44,6 @@
 
 module HplAdc12P {
   provides interface HplAdc12;
-  uses interface HplMsp430InterruptSig as SIGNAL_ADC_VECTOR;
 }
 implementation
 {
@@ -119,7 +118,7 @@ implementation
     
   async command bool HplAdc12.isBusy(){ return ADC12CTL1 & ADC12BUSY; }
 
-  inline async event void SIGNAL_ADC_VECTOR.fired() {
+  TOSH_SIGNAL(ADC_VECTOR) {
     signal HplAdc12.conversionDone(ADC12IV);
   }
 }
index bd3c9465c3ab8264ad13dadd684ed5ac186de383..e662eea537146704af97c4bcbb4096525191b8e1 100644 (file)
@@ -77,8 +77,5 @@ configuration Msp430Adc12P
   Msp430Adc12ImplP.CompareA0 -> Msp430TimerC.CompareA0;
   Msp430Adc12ImplP.CompareA1 -> Msp430TimerC.CompareA1;
 #endif
-
-  components HplMsp430InterruptSigP;
-  HplAdc12P.SIGNAL_ADC_VECTOR -> HplMsp430InterruptSigP.SIGNAL_ADC_VECTOR;
 }
 
index b6869f16e88cddf1032c6049aaf42f9145d80720..259d81a9608f48afebf332038e2061ebfc529d5e 100644 (file)
@@ -85,9 +85,6 @@ implementation {
   Dma0.Interrupt -> HplMsp430DmaP;
   Dma1.Interrupt -> HplMsp430DmaP;
   Dma2.Interrupt -> HplMsp430DmaP;
-  
-  components HplMsp430InterruptSigP;
-  HplMsp430DmaP.SIGNAL_DACDMA_VECTOR -> HplMsp430InterruptSigP.SIGNAL_DACDMA_VECTOR;
 
 }
 
index 69f49dc007f5b12f279ef12c38dc5c0b5656be92..6b58160659503bac4acd74120a7c01e30e249813 100644 (file)
@@ -61,7 +61,7 @@ module HplMsp430DmaP {
 
   provides interface HplMsp430DmaControl as DmaControl;
   provides interface HplMsp430DmaInterrupt as Interrupt;
-  uses interface HplMsp430InterruptSig as SIGNAL_DACDMA_VECTOR;
+
 }
 
 implementation {
@@ -69,7 +69,7 @@ implementation {
   MSP430REG_NORACE( DMACTL0 );
   MSP430REG_NORACE( DMACTL1 );
 
-  inline async event void SIGNAL_DACDMA_VECTOR.fired() {
+  TOSH_SIGNAL( DACDMA_VECTOR ) {
     signal Interrupt.fired();
   }
 
index 3cb8163e067291d5f81823fd77cfd44f8b63c822..50ec746aebead97ed44903f6a3c5672fb79e0fe2 100644 (file)
@@ -51,7 +51,6 @@ configuration HplMsp430InterruptC
 implementation
 {
   components HplMsp430InterruptP as HplInterruptP;
-  components HplMsp430InterruptSigP;
 #ifdef __msp430_have_port1
   Port10 = HplInterruptP.Port10;
   Port11 = HplInterruptP.Port11;
@@ -61,7 +60,6 @@ implementation
   Port15 = HplInterruptP.Port15;
   Port16 = HplInterruptP.Port16;
   Port17 = HplInterruptP.Port17;
-  HplInterruptP.SIGNAL_PORT1_VECTOR -> HplMsp430InterruptSigP.SIGNAL_PORT1_VECTOR;
 #endif
 #ifdef __msp430_have_port2
   Port20 = HplInterruptP.Port20;
@@ -72,6 +70,5 @@ implementation
   Port25 = HplInterruptP.Port25;
   Port26 = HplInterruptP.Port26;
   Port27 = HplInterruptP.Port27;
-  HplInterruptP.SIGNAL_PORT2_VECTOR -> HplMsp430InterruptSigP.SIGNAL_PORT2_VECTOR;
 #endif
 }
index b4d71b6bfd4ecdaf0501d233098fa10f717cca5f..0acdbbb0ec8897518bee61866188142d9137d204 100644 (file)
@@ -38,7 +38,4 @@ implementation
   NMI = HplInterruptP.NMI;
   OF = HplInterruptP.OF;
   ACCV = HplInterruptP.ACCV;
-  
-  components HplMsp430InterruptSigP;
-  HplInterruptP.SIGNAL_NMI_VECTOR -> HplMsp430InterruptSigP.SIGNAL_NMI_VECTOR;
 }
index 97b945b2be82667805510cffff0eac383de8f615..1942ff24204eb2c6439410d20319da5fac7072d5 100644 (file)
@@ -27,11 +27,10 @@ module HplMsp430InterruptNMIP
   provides interface HplMsp430Interrupt as NMI;
   provides interface HplMsp430Interrupt as OF;
   provides interface HplMsp430Interrupt as ACCV;
-  uses interface HplMsp430InterruptSig as SIGNAL_NMI_VECTOR;
 }
 implementation
 {
-  inline async event void SIGNAL_NMI_VECTOR.fired() 
+  TOSH_SIGNAL(NMI_VECTOR)
   {
     volatile int n = IFG1;
     if (n & NMIIFG) { signal NMI.fired(); return; }
index 4c8d899062e9ff0111b84e34b7cc7a2be684b695..9b1b1f2194f11621c54a0228b1c7ecb98a21b74e 100644 (file)
@@ -33,7 +33,6 @@ module HplMsp430InterruptP
   provides interface HplMsp430Interrupt as Port15;
   provides interface HplMsp430Interrupt as Port16;
   provides interface HplMsp430Interrupt as Port17;
-  uses interface HplMsp430InterruptSig as SIGNAL_PORT1_VECTOR;
 #endif
 #ifdef __msp430_have_port2
   provides interface HplMsp430Interrupt as Port20;
@@ -44,7 +43,6 @@ module HplMsp430InterruptP
   provides interface HplMsp430Interrupt as Port25;
   provides interface HplMsp430Interrupt as Port26;
   provides interface HplMsp430Interrupt as Port27;
-  uses interface HplMsp430InterruptSig as SIGNAL_PORT2_VECTOR;
 #endif
 
 }
@@ -52,7 +50,7 @@ implementation
 {
 
 #ifdef __msp430_have_port1
-  inline async event void SIGNAL_PORT1_VECTOR.fired()
+  TOSH_SIGNAL(PORT1_VECTOR)
   {
     volatile int n = P1IFG & P1IE;
 
@@ -157,7 +155,7 @@ implementation
 #endif
 
 #ifdef __msp430_have_port2
-  inline async event void SIGNAL_PORT2_VECTOR.fired()
+  TOSH_SIGNAL(PORT2_VECTOR)
   {
     volatile int n = P2IFG & P2IE;
 
diff --git a/tos/chips/msp430/pins/HplMsp430InterruptSig.nc b/tos/chips/msp430/pins/HplMsp430InterruptSig.nc
deleted file mode 100644 (file)
index e9c29fb..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/// $Id$
-
-/*
- *  Copyright (c) 2004-2005 Crossbow Technology, Inc.
- *  All rights reserved.
- *
- *  Permission to use, copy, modify, and distribute this software and its
- *  documentation for any purpose, without fee, and without written
- *  agreement is hereby granted, provided that the above copyright
- *  notice, the (updated) modification history and the author appear in
- *  all copies of this source code.
- *
- *  Permission is also granted to distribute this software under the
- *  standard BSD license as contained in the TinyOS distribution.
- *
- *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT HOLDERS OR CONTRIBUTORS 
- *  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
- *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, LOSS OF USE, DATA, 
- *  OR PROFITS) 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.
- */
-
-/**
- * Interface to an Msp430 external interrupt pin that exposes just the
- * interrupt vector routine for easy linking to generic components (see
- * Msp430InterruptSigP for the full interface).
- *
- * @author Martin Turon <mturon@xbow.com>
- * @author Kevin Klues <klueska@cs.stanford.edu>
- * @see Msp430InterruptSigP
- */
-interface HplMsp430InterruptSig
-{
-  /**
-   * Signalled when an interrupt occurs on a pin
-   */
-  inline async event void fired();
-}
-
diff --git a/tos/chips/msp430/pins/HplMsp430InterruptSigP.nc b/tos/chips/msp430/pins/HplMsp430InterruptSigP.nc
deleted file mode 100644 (file)
index 408ab9b..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2008 Stanford University.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - 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.
- * - Neither the name of the Stanford University nor the names of
- *   its contributors may be used to endorse or promote products derived
- *   from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 STANFORD
- * UNIVERSITY OR ITS 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.
- */
-
-/**
- * @author Kevin Klues <klueska@cs.stanford.edu>
- */
-
-module HplMsp430InterruptSigP
-{
-   provides {
-    interface HplMsp430InterruptSig as SIGNAL_ADC_VECTOR;
-    interface HplMsp430InterruptSig as SIGNAL_DACDMA_VECTOR;
-    interface HplMsp430InterruptSig as SIGNAL_NMI_VECTOR;
-    interface HplMsp430InterruptSig as SIGNAL_PORT1_VECTOR;
-    interface HplMsp430InterruptSig as SIGNAL_PORT2_VECTOR;
-    interface HplMsp430InterruptSig as SIGNAL_TIMERA0_VECTOR;
-    interface HplMsp430InterruptSig as SIGNAL_TIMERA1_VECTOR;
-    interface HplMsp430InterruptSig as SIGNAL_TIMERB0_VECTOR;
-    interface HplMsp430InterruptSig as SIGNAL_TIMERB1_VECTOR;
-    interface HplMsp430InterruptSig as SIGNAL_UART0RX_VECTOR;
-    interface HplMsp430InterruptSig as SIGNAL_UART0TX_VECTOR;
-    interface HplMsp430InterruptSig as SIGNAL_UART1RX_VECTOR;
-    interface HplMsp430InterruptSig as SIGNAL_UART1TX_VECTOR;
-  }
-}
-implementation {
-  #define MSP430_INTERRUPT_HANDLER(NAME)                                                               \
-    default async event void SIGNAL_##NAME.fired() {}                                  \
-    TOSH_SIGNAL(NAME) {                                                                                                        \
-      signal SIGNAL_##NAME.fired();                                                                            \
-    }
-
-  MSP430_INTERRUPT_HANDLER(ADC_VECTOR)
-  MSP430_INTERRUPT_HANDLER(DACDMA_VECTOR)
-  MSP430_INTERRUPT_HANDLER(NMI_VECTOR)
-  MSP430_INTERRUPT_HANDLER(PORT1_VECTOR)
-  MSP430_INTERRUPT_HANDLER(PORT2_VECTOR)
-  MSP430_INTERRUPT_HANDLER(TIMERA0_VECTOR)
-  MSP430_INTERRUPT_HANDLER(TIMERA1_VECTOR)
-  MSP430_INTERRUPT_HANDLER(TIMERB0_VECTOR)
-  MSP430_INTERRUPT_HANDLER(TIMERB1_VECTOR)
-  MSP430_INTERRUPT_HANDLER(UART0RX_VECTOR)
-  MSP430_INTERRUPT_HANDLER(UART0TX_VECTOR)
-  MSP430_INTERRUPT_HANDLER(UART1RX_VECTOR)
-  MSP430_INTERRUPT_HANDLER(UART1TX_VECTOR)
-}
index e1d6a23f1656773ecf59d0fd98e3b518acb0b8f1..65b23cd8dfa39ae51f4ce729cdf087d218732951 100644 (file)
@@ -159,11 +159,5 @@ implementation
   CaptureB6 = Msp430TimerB6.Capture;
   Msp430TimerB6.Timer -> Msp430TimerB.Timer;
   Msp430TimerB6.Event -> Msp430TimerB.Event[6];
-  
-  components HplMsp430InterruptSigP;
-  Common.SIGNAL_TIMERA0_VECTOR -> HplMsp430InterruptSigP.SIGNAL_TIMERA0_VECTOR;
-  Common.SIGNAL_TIMERA1_VECTOR -> HplMsp430InterruptSigP.SIGNAL_TIMERA1_VECTOR;
-  Common.SIGNAL_TIMERB0_VECTOR -> HplMsp430InterruptSigP.SIGNAL_TIMERB0_VECTOR;
-  Common.SIGNAL_TIMERB1_VECTOR -> HplMsp430InterruptSigP.SIGNAL_TIMERB1_VECTOR;
 }
 
index 707ca7dbc088d80755acba0d729763cb5a87e2a1..64c27704f1127abfc0fd29fdc966bbc365b4853c 100644 (file)
@@ -1,44 +1,16 @@
 
-/* "Copyright (c) 2000-2003 The Regents of the University of California.
- * All rights reserved.
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose, without fee, and without written agreement
- * is hereby granted, provided that the above copyright notice, the following
- * two paragraphs and the author appear in all copies of this software.
- *
- * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
- * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
- * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY
- * OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
- * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
- * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
- */
-/**
- * @author Cory Sharp <cssharp@eecs.berkeley.edu>
- */
 module Msp430TimerCommonP
 {
   provides interface Msp430TimerEvent as VectorTimerA0;
   provides interface Msp430TimerEvent as VectorTimerA1;
   provides interface Msp430TimerEvent as VectorTimerB0;
   provides interface Msp430TimerEvent as VectorTimerB1;
-  uses interface HplMsp430InterruptSig as SIGNAL_TIMERA0_VECTOR;
-  uses interface HplMsp430InterruptSig as SIGNAL_TIMERA1_VECTOR;
-  uses interface HplMsp430InterruptSig as SIGNAL_TIMERB0_VECTOR;
-  uses interface HplMsp430InterruptSig as SIGNAL_TIMERB1_VECTOR;
 }
 implementation
 {
-  inline async event void SIGNAL_TIMERA0_VECTOR.fired() { signal VectorTimerA0.fired(); }
-  inline async event void SIGNAL_TIMERA1_VECTOR.fired() { signal VectorTimerA1.fired(); }
-  inline async event void SIGNAL_TIMERB0_VECTOR.fired() { signal VectorTimerB0.fired(); }
-  inline async event void SIGNAL_TIMERB1_VECTOR.fired() { signal VectorTimerB1.fired(); }
+  TOSH_SIGNAL(TIMERA0_VECTOR) { signal VectorTimerA0.fired(); }
+  TOSH_SIGNAL(TIMERA1_VECTOR) { signal VectorTimerA1.fired(); }
+  TOSH_SIGNAL(TIMERB0_VECTOR) { signal VectorTimerB0.fired(); }
+  TOSH_SIGNAL(TIMERB1_VECTOR) { signal VectorTimerB1.fired(); }
 }
 
index 8c87accc68b6d517f6289bd89e00ce976ff2d53b..c1060df216c397c0b461a8dd7e8907ec6e436807 100644 (file)
@@ -85,7 +85,4 @@ implementation {
   HplUsartP.URXD -> GIO.URXD0;
   HplUsartP.UTXD -> GIO.UTXD0;
   
-  components HplMsp430InterruptSigP;
-  HplUsartP.SIGNAL_UART0RX_VECTOR -> HplMsp430InterruptSigP.SIGNAL_UART0RX_VECTOR;
-  HplUsartP.SIGNAL_UART0TX_VECTOR -> HplMsp430InterruptSigP.SIGNAL_UART0TX_VECTOR;
 }
index 228e2b14e85c823081bba0414e9c8a4f77b5ee8b..cf618bfbbdba8cc75855497c1102b256380c6293 100644 (file)
@@ -82,8 +82,6 @@ module HplMsp430Usart0P {
   uses interface HplMsp430GeneralIO as UCLK;
   uses interface HplMsp430GeneralIO as URXD;
   uses interface HplMsp430GeneralIO as UTXD;
-  uses interface HplMsp430InterruptSig as SIGNAL_UART0RX_VECTOR;
-  uses interface HplMsp430InterruptSig as SIGNAL_UART0TX_VECTOR;
 }
 
 implementation
@@ -95,12 +93,12 @@ implementation
   MSP430REG_NORACE(U0RCTL);
   MSP430REG_NORACE(U0TXBUF);
   
-  inline async event void SIGNAL_UART0RX_VECTOR.fired() {
+  TOSH_SIGNAL(UART0RX_VECTOR) {
     uint8_t temp = U0RXBUF;
     signal Interrupts.rxDone(temp);
   }
   
-  inline async event void SIGNAL_UART0TX_VECTOR.fired() {
+  TOSH_SIGNAL(UART0TX_VECTOR) {
     if ( call HplI2C.isI2C() )
       signal I2CInterrupts.fired();
     else
index aefd47f7131aeb7972cbc7794adf2701c4c9a127..78b932324460332afdd5dd45bf76fff34f74ce91 100644 (file)
@@ -85,8 +85,5 @@ implementation {
   HplUsartP.UCLK -> GIO.UCLK1;
   HplUsartP.URXD -> GIO.URXD1;
   HplUsartP.UTXD -> GIO.UTXD1;
-  
-  components HplMsp430InterruptSigP;
-  HplUsartP.SIGNAL_UART1RX_VECTOR -> HplMsp430InterruptSigP.SIGNAL_UART1RX_VECTOR;
-  HplUsartP.SIGNAL_UART1TX_VECTOR -> HplMsp430InterruptSigP.SIGNAL_UART1TX_VECTOR;
+
 }
index d35e9f502762bc173eceaaaf9a1a7300beb5fc4a..d5a8a268b54080e3a95b2a97463a84d77c51ee26 100644 (file)
@@ -80,8 +80,6 @@ module HplMsp430Usart1P {
   uses interface HplMsp430GeneralIO as UCLK;
   uses interface HplMsp430GeneralIO as URXD;
   uses interface HplMsp430GeneralIO as UTXD;
-  uses interface HplMsp430InterruptSig as SIGNAL_UART1RX_VECTOR;
-  uses interface HplMsp430InterruptSig as SIGNAL_UART1TX_VECTOR;
 }
 
 implementation
@@ -93,12 +91,14 @@ implementation
   MSP430REG_NORACE(U1RCTL);
   MSP430REG_NORACE(U1TXBUF);
 
-  inline async event void SIGNAL_UART1RX_VECTOR.fired() {
+
+
+  TOSH_SIGNAL(UART1RX_VECTOR) {
     uint8_t temp = U1RXBUF;
     signal Interrupts.rxDone(temp);
   }
 
-  inline async event void SIGNAL_UART1TX_VECTOR.fired() {
+  TOSH_SIGNAL(UART1TX_VECTOR) {
     signal Interrupts.txDone();
   }