X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fstmf0%2Fao_spi_stm.c;h=04827cf72c6ee92c8e46bf072690f1a472ff6dfd;hb=22c5cacfdf766be6ccd1d959eeaf02e75cfa05fb;hp=d83f06580380014fb0a09583ee276e9b19dc5b49;hpb=56310df28e96878c463eb2dae2791652606b4b59;p=fw%2Faltos diff --git a/src/stmf0/ao_spi_stm.c b/src/stmf0/ao_spi_stm.c index d83f0658..04827cf7 100644 --- a/src/stmf0/ao_spi_stm.c +++ b/src/stmf0/ao_spi_stm.c @@ -451,8 +451,8 @@ ao_spi_config(uint8_t spi_index, uint32_t speed) (1 << STM_SPI_CR1_SPE) | /* Enable SPI unit */ (speed << 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)); + (AO_SPI_CPOL(spi_index) << STM_SPI_CR1_CPOL) | /* Format */ + (AO_SPI_CPHA(spi_index) << STM_SPI_CR1_CPHA)); } uint8_t