Skip to content

Commit

Permalink
fixed too slow spi clockrate on rfa1
Browse files Browse the repository at this point in the history
  • Loading branch information
andrasbiro committed Apr 9, 2015
1 parent 1489a03 commit d77de87
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tos/chips/atm128rfa1/spi/Atm128SpiP.nc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d77de87

Please sign in to comment.