You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2021/02/01 07:15:45 UTC

[mynewt-core] 02/03: stm32/hal_spi: Fix alternate function for STM32F0 SPI_1

This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 5bc7c103fb3b00e24e42ab428ef44ec9eb0c38ee
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Fri Jan 22 14:47:00 2021 +0100

    stm32/hal_spi: Fix alternate function for STM32F0 SPI_1
    
    Alternate function for SPI2 for STM32F0xx is 0 like
    for STM32L0xx and not 5 as for all other MCU's
---
 hw/mcu/stm/stm32_common/src/hal_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/mcu/stm/stm32_common/src/hal_spi.c b/hw/mcu/stm/stm32_common/src/hal_spi.c
index 636cde0..9f0222d 100644
--- a/hw/mcu/stm/stm32_common/src/hal_spi.c
+++ b/hw/mcu/stm/stm32_common/src/hal_spi.c
@@ -618,7 +618,7 @@ hal_spi_config(int spi_num, struct hal_spi_settings *settings)
     case 1:
         __HAL_RCC_SPI2_CLK_ENABLE();
 #if !MYNEWT_VAL(MCU_STM32F1)
-    #if !MYNEWT_VAL(MCU_STM32L0)
+    #if !MYNEWT_VAL(MCU_STM32L0) && !MYNEWT_VAL(MCU_STM32F0)
         gpio.Alternate = GPIO_AF5_SPI2;
     #else
         gpio.Alternate = GPIO_AF0_SPI2;