From 9fca058256aebefdb8c274b66fa320df1ab951a4 Mon Sep 17 00:00:00 2001 From: smckown Date: Tue, 10 Mar 2009 01:36:20 +0000 Subject: [PATCH] This change allows msp430 usci SpiByte.write to terminate if the spi resource is released in a higher level interrupt. --- tos/chips/msp430/usci/Msp430SpiP.nc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(); } } -- 2.39.2