From 5613a6ebebf7bcd6f01b8f4df129698788406a8f Mon Sep 17 00:00:00 2001 From: rincon Date: Thu, 25 Jan 2007 19:12:23 +0000 Subject: [PATCH] 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. --- tos/chips/atm128/spi/Atm128SpiP.nc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(); -- 2.39.2