From cb17f736919c7a258b50e26caad5b1c22c30fc1c Mon Sep 17 00:00:00 2001 From: mmaroti Date: Wed, 9 Sep 2009 19:44:16 +0000 Subject: [PATCH] Revert the SpiByte.write function to its original form till the SPI access bug is found --- tos/chips/atm128/spi/Atm128SpiP.nc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tos/chips/atm128/spi/Atm128SpiP.nc b/tos/chips/atm128/spi/Atm128SpiP.nc index d457e42a..1838f7b0 100644 --- a/tos/chips/atm128/spi/Atm128SpiP.nc +++ b/tos/chips/atm128/spi/Atm128SpiP.nc @@ -126,10 +126,14 @@ implementation { } async command uint8_t SpiByte.write( uint8_t tx ) { - /* no need to enable the SPI bus since that must have been done - when the resource was granted */ - // call Spi.enableSpi(TRUE); - // call McuPowerState.update(); + /* There is no need to enable the SPI bus and update the power state + here since that must have been done when the resource was granted. + However there seems to be a bug somewhere in the radio driver for + the MicaZ platform so we cannot remove the following two lines + before that problem is resolved. (Miklos Maroti) */ + call Spi.enableSpi(TRUE); + call McuPowerState.update(); + call Spi.write( tx ); while ( !( SPSR & 0x80 ) ); return call Spi.read(); -- 2.39.2