]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/msp430/pins/HplMsp430InterruptNMIP.nc
Update to centralize inside one module where all interrupt handlers are signaled...
[tinyos-2.x.git] / tos / chips / msp430 / pins / HplMsp430InterruptNMIP.nc
index f364395f35bb8e8c0d7d42613bf564192abea9d5..97b945b2be82667805510cffff0eac383de8f615 100644 (file)
@@ -27,10 +27,11 @@ 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
 {
-  TOSH_SIGNAL(NMI_VECTOR)
+  inline async event void SIGNAL_NMI_VECTOR.fired() 
   {
     volatile int n = IFG1;
     if (n & NMIIFG) { signal NMI.fired(); return; }
@@ -72,9 +73,9 @@ implementation
   async command void OF.clear() { atomic IFG1 &= ~OFIFG; }
   async command void ACCV.clear() { atomic FCTL3 &= ~ACCVIFG; }
 
-  async command bool NMI.getValue() { bool b; atomic b=(IFG1 >> NMIIFG) & 0x01; return b; }
-  async command bool OF.getValue() { bool b; atomic b=(IFG1 >> OFIFG) & 0x01; return b; }
-  async command bool ACCV.getValue() { bool b; atomic b=(FCTL3 >> ACCVIFG) & 0x01; return b; }
+  async command bool NMI.getValue() { bool b; atomic b=(IFG1 & NMIIFG) & 0x01; return b; }
+  async command bool OF.getValue() { bool b; atomic b=(IFG1 & OFIFG) & 0x01; return b; }
+  async command bool ACCV.getValue() { bool b; atomic b=(FCTL3 & ACCVIFG) & 0x01; return b; }
 
   async command void NMI.edge(bool l2h) { 
     volatile uint16_t _watchdog;