Skip to content

Commit

Permalink
Fix SPI baudrate for STM32F0 targets
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Solartraveler committed Oct 13, 2021
1 parent 18dc5eb commit 6e8da47
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion spi.c
Expand Up @@ -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 */
Expand Down

0 comments on commit 6e8da47

Please sign in to comment.