]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/msp430/usci/Msp430SpiP.nc
Remove redundant atomic blocks.
[tinyos-2.x.git] / tos / chips / msp430 / usci / Msp430SpiP.nc
index b4a25436232a75d2e5010ce30edac84395a8c8db..22bfbbd376b1aa00237b8539a94b7ab402ea7a4f 100644 (file)
@@ -166,7 +166,7 @@ implementation {
     error_t error = (m_pos == m_len) ? SUCCESS : FAIL;
 
     m_len = 0;
-    signal SpiPacket.sendDone(m_txBuf, m_rxBuf, m_pos, error);
+    atomic signal SpiPacket.sendDone(m_txBuf, m_rxBuf, m_pos, error);
   }
 
   async command void ResourceConfigure.unconfigure()
@@ -229,13 +229,15 @@ implementation {
 
   async command uint8_t SpiByte.write(uint8_t byte)
   {
-    if (isBusy())
-      return 0;
-    else {
-      waitOnTx();
-      call Registers.setTxbuf(byte);
-      waitOnRx();
-      return call Registers.getRxbuf();
+    atomic {
+      if (isBusy())
+       return 0;
+      else {
+       waitOnTx();
+       call Registers.setTxbuf(byte);
+       waitOnRx();
+       return call Registers.getRxbuf();
+      }
     }
   }