From 3efa31a8047730516f1e7eaf343ee5beee2b5365 Mon Sep 17 00:00:00 2001 From: Igor Biletskyy Date: Thu, 31 Aug 2023 09:55:12 -0700 Subject: [PATCH] F4: fix GMLAN clocks (#1624) * init * misra --- board/drivers/gmlan_alt.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/board/drivers/gmlan_alt.h b/board/drivers/gmlan_alt.h index 53f46c2e0..45378747d 100644 --- a/board/drivers/gmlan_alt.h +++ b/board/drivers/gmlan_alt.h @@ -128,9 +128,9 @@ void setup_timer(void) { REGISTER_INTERRUPT(TIM8_BRK_TIM12_IRQn, TIM12_IRQ_Handler, 40000U, FAULT_INTERRUPT_RATE_GMLAN) // setup - register_set(&(TIM12->PSC), (48-1), 0xFFFFU); // Tick on 1 us + register_set(&(TIM12->PSC), (APB1_TIMER_FREQ-1U), 0xFFFFU); // Tick on 1 us register_set(&(TIM12->CR1), TIM_CR1_CEN, 0x3FU); // Enable - register_set(&(TIM12->ARR), (30-1), 0xFFFFU); // 33.3 kbps + register_set(&(TIM12->ARR), (30U-1U), 0xFFFFU); // 33.3 kbps // in case it's disabled NVIC_EnableIRQ(TIM8_BRK_TIM12_IRQn);