From: smckown Date: Tue, 10 Mar 2009 01:36:20 +0000 (+0000) Subject: This change allows msp430 usci SpiByte.write to terminate if the spi resource X-Git-Tag: release/2.1.0-1~21 X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=commitdiff_plain;h=9fca058256aebefdb8c274b66fa320df1ab951a4 This change allows msp430 usci SpiByte.write to terminate if the spi resource is released in a higher level interrupt. --- diff --git a/tos/chips/msp430/usci/Msp430SpiP.nc b/tos/chips/msp430/usci/Msp430SpiP.nc index 84878dd1..dfdf5afd 100644 --- a/tos/chips/msp430/usci/Msp430SpiP.nc +++ b/tos/chips/msp430/usci/Msp430SpiP.nc @@ -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(); } }