altos: Reduce STM SPI data rate to 4MHz
authorKeith Packard <keithp@keithp.com>
Sat, 16 Jun 2012 05:41:17 +0000 (22:41 -0700)
committerKeith Packard <keithp@keithp.com>
Sat, 16 Jun 2012 05:41:17 +0000 (22:41 -0700)
cc1120 doesn't want more than 6.1MHz, otherwise it gets very angry.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/stm/ao_spi_stm.c

index 8bb0d8e8a2be33e869e393a75598be8dac7c5329..8784d98564feeb5f45e914ed014d8e3824a7269a 100644 (file)
@@ -282,7 +282,7 @@ ao_spi_get(uint8_t spi_index)
                        (1 << STM_SPI_CR1_SSI) |                        /*  ... */
                        (0 << STM_SPI_CR1_LSBFIRST) |                   /* Big endian */
                        (1 << STM_SPI_CR1_SPE) |                        /* Enable SPI unit */
-                       (STM_SPI_CR1_BR_PCLK_4 << STM_SPI_CR1_BR) |     /* baud rate to pclk/4 */
+                       (STM_SPI_CR1_BR_PCLK_8 << STM_SPI_CR1_BR) |     /* baud rate to pclk/4 */
                        (1 << STM_SPI_CR1_MSTR) |
                        (0 << STM_SPI_CR1_CPOL) |                       /* Format 0 */
                        (0 << STM_SPI_CR1_CPHA));