]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
This change allows msp430 usci SpiByte.write to terminate if the spi resource
authorsmckown <smckown@4bc1554a-c7f2-4f65-a403-e0be01f0239c>
Tue, 10 Mar 2009 01:36:20 +0000 (01:36 +0000)
committerR. Steve McKown <rsmckown@gmail.com>
Tue, 1 Dec 2009 03:01:17 +0000 (20:01 -0700)
is released in a higher level interrupt.

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();
     }
   }