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);