From 860e71622e1c9ab558aa7ff2c6fff2b2b8a1862d Mon Sep 17 00:00:00 2001 From: "Konstantin Kirik (snegovick)" Date: Wed, 7 Jan 2026 21:07:48 +0300 Subject: Re-use CONFIG_definitions instead of cmsis ones --- os/arch/aarch32/armv7e_m/stm32f7/system_stm32f7xx.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'os/arch') diff --git a/os/arch/aarch32/armv7e_m/stm32f7/system_stm32f7xx.c b/os/arch/aarch32/armv7e_m/stm32f7/system_stm32f7xx.c index bf363777..695a9271 100644 --- a/os/arch/aarch32/armv7e_m/stm32f7/system_stm32f7xx.c +++ b/os/arch/aarch32/armv7e_m/stm32f7/system_stm32f7xx.c @@ -47,10 +47,6 @@ #include #include "stm32f7xx.h" -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)25000000) /*!< Default value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - #if !defined (HSI_VALUE) #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ #endif /* HSI_VALUE */ @@ -122,7 +118,7 @@ is no need to call the 2 first functions listed above, since SystemCoreClock variable is updated automatically. */ - uint32_t SystemCoreClock = 16000000; + uint32_t SystemCoreClock = HSI_VALUE; const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4}; @@ -211,7 +207,7 @@ void SystemCoreClockUpdate(void) SystemCoreClock = HSI_VALUE; break; case 0x04: /* HSE used as system clock source */ - SystemCoreClock = HSE_VALUE; + SystemCoreClock = CONFIG_BOARD_HSE_CLK; break; case 0x08: /* PLL used as system clock source */ @@ -224,7 +220,7 @@ void SystemCoreClockUpdate(void) if (pllsource != 0) { /* HSE used as PLL clock source */ - pllvco = (HSE_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6); + pllvco = (CONFIG_BOARD_HSE_CLK / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6); } else { @@ -233,7 +229,7 @@ void SystemCoreClockUpdate(void) } pllp = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLP) >>16) + 1 ) *2; - SystemCoreClock = pllvco/pllp; + SystemCoreClock = pllvco / pllp; break; default: SystemCoreClock = HSI_VALUE; -- cgit v1.2.3