Fix SPI baudrate for STM32F0 targets

rcc.h provides a define for rcc_apb2_frequency which then collided with the local variable. As a result the SPI frequency was always 24MHz, no matter of the desired frequency.
This commit is contained in:
Solartraveler 2021-10-13 22:09:21 +02:00
parent 18dc5eb771
commit 6e8da47519
1 changed files with 0 additions and 1 deletions

1
spi.c
View File

@ -49,7 +49,6 @@ uint32_t spi_setup(uint32_t speed_hz) {
#ifdef STM32F0
rcc_periph_clock_enable(RCC_DMA);
uint32_t rcc_apb2_frequency = rcc_apb1_frequency; /* STM32F0x2 only has one APB. */
#else
rcc_periph_clock_enable(RCC_DMA1);
#endif /* STM32F0 */