From d77de87db41321d26ebd88f144908223ba8949b5 Mon Sep 17 00:00:00 2001 From: Andras Biro Date: Thu, 9 Apr 2015 19:38:36 +0200 Subject: [PATCH] fixed too slow spi clockrate on rfa1 --- tos/chips/atm128rfa1/spi/Atm128SpiP.nc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tos/chips/atm128rfa1/spi/Atm128SpiP.nc b/tos/chips/atm128rfa1/spi/Atm128SpiP.nc index 68456a0089..e37dc875f7 100644 --- a/tos/chips/atm128rfa1/spi/Atm128SpiP.nc +++ b/tos/chips/atm128rfa1/spi/Atm128SpiP.nc @@ -130,22 +130,22 @@ implementation { call Spi.enableSpi(TRUE); //calculating prescaler for desired spi clockrate with floor function to the nearest available clockrate - #if (PLATFORM_MHZ*1000)/SPI_CLOCKRATE>=64 + #if (PLATFORM_MHZ*1000)/SPI_CLOCKRATE>=128 call Spi.setMasterDoubleSpeed(FALSE); call Spi.setClock(3); - #elif (PLATFORM_MHZ*1000)/SPI_CLOCKRATE>=32 + #elif (PLATFORM_MHZ*1000)/SPI_CLOCKRATE>=64 call Spi.setMasterDoubleSpeed(FALSE); call Spi.setClock(2); - #elif (PLATFORM_MHZ*1000)/SPI_CLOCKRATE>=16 + #elif (PLATFORM_MHZ*1000)/SPI_CLOCKRATE>=32 call Spi.setMasterDoubleSpeed(TRUE); call Spi.setClock(2); - #elif (PLATFORM_MHZ*1000)/SPI_CLOCKRATE>=8 + #elif (PLATFORM_MHZ*1000)/SPI_CLOCKRATE>=16 call Spi.setMasterDoubleSpeed(FALSE); call Spi.setClock(1); - #elif (PLATFORM_MHZ*1000)/SPI_CLOCKRATE>=4 + #elif (PLATFORM_MHZ*1000)/SPI_CLOCKRATE>=8 call Spi.setMasterDoubleSpeed(TRUE); call Spi.setClock(1); - #elif (PLATFORM_MHZ*1000)/SPI_CLOCKRATE>=2 + #elif (PLATFORM_MHZ*1000)/SPI_CLOCKRATE>=4 call Spi.setMasterDoubleSpeed(FALSE); call Spi.setClock(0); #else