Explorar o código

[HAL][RCC] Correct the configuration macro of I2S clock source and the value of I2S external clock source

Eya %!s(int64=3) %!d(string=hai) anos
pai
achega
08d0be9e82
Modificáronse 2 ficheiros con 3 adicións e 3 borrados
  1. 1 1
      Inc/Legacy/stm32_hal_legacy.h
  2. 2 2
      Inc/stm32f4xx_hal_rcc_ex.h

+ 1 - 1
Inc/Legacy/stm32_hal_legacy.h

@@ -1283,7 +1283,7 @@ extern "C" {
 #define TIM_TIM3_TI1_COMP1COMP2_OUT   TIM_TIM3_TI1_COMP1_COMP2
 #endif
 
-#if defined(STM32U5) || defined(STM32MP2)
+#if defined(STM32U5)
 #define OCREF_CLEAR_SELECT_Pos       OCREF_CLEAR_SELECT_POS
 #define OCREF_CLEAR_SELECT_Msk       OCREF_CLEAR_SELECT_MSK
 #endif

+ 2 - 2
Inc/stm32f4xx_hal_rcc_ex.h

@@ -526,7 +526,7 @@ typedef struct
   * @{
   */
 #define RCC_I2SCLKSOURCE_PLLI2S         0x00000000U
-#define RCC_I2SCLKSOURCE_EXT            0x00000001U
+#define RCC_I2SCLKSOURCE_EXT            RCC_CFGR_I2SSRC
 /**
   * @}
   */
@@ -6101,7 +6101,7 @@ typedef struct
   *            @arg RCC_I2SCLKSOURCE_EXT: External clock mapped on the I2S_CKIN pin
   *                                       used as I2S clock source.
   */
-#define __HAL_RCC_I2S_CONFIG(__SOURCE__) (*(__IO uint32_t *) RCC_CFGR_I2SSRC_BB = (__SOURCE__))
+#define __HAL_RCC_I2S_CONFIG(__SOURCE__) (MODIFY_REG(RCC->CFGR, RCC_CFGR_I2SSRC, (__SOURCE__)))
 
 
 /** @brief  Macro to get the I2S clock source (I2SCLK).