From a5a84340db6b29ec0df338047e728863fe274399 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 13 Oct 2024 13:10:34 +1100 Subject: [PATCH] fixed e230 and g431 UTILITY_TIMER to be 1MHz --- Mcu/e230/Src/peripherals.c | 4 ++-- Mcu/g431/Src/peripherals.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Mcu/e230/Src/peripherals.c b/Mcu/e230/Src/peripherals.c index 582b5473..ae7f46a9 100644 --- a/Mcu/e230/Src/peripherals.c +++ b/Mcu/e230/Src/peripherals.c @@ -225,7 +225,7 @@ void TIMER16_Init(void) { rcu_periph_clock_enable(RCU_TIMER16); TIMER_CAR(TIMER16) = 0xFFFF; - TIMER_PSC(TIMER16) = 35; + TIMER_PSC(TIMER16) = 71; timer_auto_reload_shadow_enable(TIMER16); timer_enable(TIMER16); } @@ -440,4 +440,4 @@ void enableCorePeripherals() EXTI_INTEN |= (uint32_t)EXTI_15; UN_TIM_Init(); -} \ No newline at end of file +} diff --git a/Mcu/g431/Src/peripherals.c b/Mcu/g431/Src/peripherals.c index a483904c..2fa810ea 100644 --- a/Mcu/g431/Src/peripherals.c +++ b/Mcu/g431/Src/peripherals.c @@ -384,7 +384,7 @@ void MX_TIM17_Init(void) { LL_TIM_InitTypeDef TIM_InitStruct = { 0 }; LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_TIM17); - TIM_InitStruct.Prescaler = 149; + TIM_InitStruct.Prescaler = 159; TIM_InitStruct.CounterMode = LL_TIM_COUNTERMODE_UP; TIM_InitStruct.Autoreload = 65535; TIM_InitStruct.ClockDivision = LL_TIM_CLOCKDIVISION_DIV1;