]> 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 6d8e9f4cea8eb6fa26960f90c17f5dfe4bbbe165..22bfbbd376b1aa00237b8539a94b7ab402ea7a4f 100644 (file)
@@ -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();
+      }
     }
   }