]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/msp430/usci/Msp430SpiP.nc
This change allows msp430 usci SpiByte.write to terminate if the spi resource
[tinyos-2.x.git] / tos / chips / msp430 / usci / Msp430SpiP.nc
index 84878dd17b75f6b90aa37ceefe808109034b9153..dfdf5afd635089b30c5076deae08baa4aa14a245 100644 (file)
@@ -160,9 +160,9 @@ implementation {
     if (isBusy())
       return 0;
     else {
-      while (!call Registers.getIfgTx());
+      while (!call Registers.getIfgTx() && !call Registers.getCtl1(UCSWRST));
       call Registers.setTxbuf(byte);
-      while(!call Registers.getIfgRx());
+      while(!call Registers.getIfgRx() && !call Registers.getCtl1(UCSWRST));
       return call Registers.getRxbuf();
     }
   }