From: rincon Date: Thu, 25 Jan 2007 19:12:23 +0000 (+0000) Subject: MicaZ's CC2420 Transmit (?) has a problem where it's writing bytes to the SPI bus... X-Git-Tag: tinyos/2.0.1~215 X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=commitdiff_plain;h=5613a6ebebf7bcd6f01b8f4df129698788406a8f;p=tinyos-2.x.git MicaZ's CC2420 Transmit (?) has a problem where it's writing bytes to the SPI bus, but then the SPI bus gets disabled. This sends Atm128SpiP into an infinite loop. This version ensures the SPI bus is enabled before trying to write to it, but the real culprit needs to be tracked down probably inside of CC2420TransmitP. --- diff --git a/tos/chips/atm128/spi/Atm128SpiP.nc b/tos/chips/atm128/spi/Atm128SpiP.nc index 41874124..65edf25e 100644 --- a/tos/chips/atm128/spi/Atm128SpiP.nc +++ b/tos/chips/atm128/spi/Atm128SpiP.nc @@ -125,8 +125,10 @@ implementation { } call McuPowerState.update(); } - + async command uint8_t SpiByte.write( uint8_t tx ) { + call Spi.enableSpi(TRUE); + call McuPowerState.update(); call Spi.write( tx ); while ( !( SPSR & 0x80 ) ); return call Spi.read();