mirror of https://github.com/commaai/panda.git
parent
f89207328b
commit
3efa31a804
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue