X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Fchips%2Fatm128%2Fspi%2FAtm128SpiP.nc;h=1838f7b0d00a48c6a76858b0341c825ebeca97d7;hb=cb17f736919c7a258b50e26caad5b1c22c30fc1c;hp=d457e42a7ce9847e932b08450bc98c315d66dd0d;hpb=03131a0f96eb7a88d130e42bacad7805c403335e;p=tinyos-2.x.git 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();