瀏覽代碼

[stm32][drv_spi] revert the typo

it shouldn't be a static variable.
Meco Man 2 年之前
父節點
當前提交
28b7c88269
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. 2 3
      bsp/stm32/libraries/HAL_Drivers/drv_spi.c

+ 2 - 3
bsp/stm32/libraries/HAL_Drivers/drv_spi.c

@@ -140,9 +140,8 @@ static rt_err_t stm32_spi_init(struct stm32_spi *spi_drv, struct rt_spi_configur
 
     spi_handle->Init.NSS = SPI_NSS_SOFT;
 
-    static uint32_t SPI_CLOCK;
-
-/* Some series may only have APBPERIPH_BASE, but don't have HAL_RCC_GetPCLK2Freq */
+    uint32_t SPI_CLOCK = 0UL;
+    /* Some series may only have APBPERIPH_BASE, but don't have HAL_RCC_GetPCLK2Freq */
 #if defined(APBPERIPH_BASE)
     SPI_CLOCK = HAL_RCC_GetPCLK1Freq();
 #elif defined(APB1PERIPH_BASE) || defined(APB2PERIPH_BASE)