mirror of https://github.com/ARMmbed/mbed-os.git
Generate update event when initializing the ticker so the new prescaler
value is used straight away.pull/8/head
parent
e6ff45d87c
commit
8ffca414a5
|
|
@ -32,6 +32,7 @@ void us_ticker_init(void) {
|
|||
|
||||
uint32_t prescale = PCLK / 1000000; // default to 1MHz (1 us ticks)
|
||||
US_TICKER_TIMER->PSC = prescale - 1;
|
||||
US_TICKER_TIMER->EGR |= TIM_EGR_UG;
|
||||
US_TICKER_TIMER->CR1 |= TIM_CR1_CEN;
|
||||
|
||||
NVIC_SetVector(US_TICKER_TIMER_IRQn, (uint32_t)us_ticker_irq_handler);
|
||||
|
|
|
|||
Loading…
Reference in New Issue