Skip to content

Commit 3c3e04f

Browse files
authored
Merge pull request #3739 from jeromecoutant/PR_F7_HSE
STM32F7 : remove multiple HSE_VALUE define value
2 parents b7dce71 + 565ad77 commit 3c3e04f

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F746xG/TARGET_DISCO_F746NG/system_stm32f7xx.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@
8383

8484
HAL_StatusTypeDef HAL_Init(void);
8585

86-
#define HSE_VALUE ((uint32_t)25000000) /*!< Default value of the External oscillator in Hz */
86+
#if !defined (HSE_VALUE)
87+
#define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */
88+
#endif /* HSE_VALUE */
8789

8890
#if !defined (HSI_VALUE)
8991
#define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/

targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F769xI/TARGET_DISCO_F769NI/system_stm32f7xx.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@
8383

8484
HAL_StatusTypeDef HAL_Init(void);
8585

86-
#define HSE_VALUE ((uint32_t)25000000) /*!< Default value of the External oscillator in Hz */
86+
#if !defined (HSE_VALUE)
87+
#define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */
88+
#endif /* HSE_VALUE */
8789

8890
#if !defined (HSI_VALUE)
8991
#define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/

targets/TARGET_STM/TARGET_STM32F7/device/stm32f7xx_hal_conf.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,12 @@
103103
* This value is used by the RCC HAL module to compute the system frequency
104104
* (when HSE is used as system clock source, directly or through the PLL).
105105
*/
106-
#if !defined (HSE_VALUE)
107-
#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */
108-
#endif /* HSE_VALUE */
106+
//#if !defined (HSE_VALUE)
107+
#if defined(TARGET_DISCO_F746NG) || defined(TARGET_DISCO_F769NI)
108+
#define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */
109+
#else
110+
#define HSE_VALUE 8000000U /*!< Default value of the External oscillator in Hz */
111+
#endif
109112

110113
#if !defined (HSE_STARTUP_TIMEOUT)
111114
#define HSE_STARTUP_TIMEOUT 200U /*!< Time out for HSE start up, in ms */

0 commit comments

Comments
 (0)