mbed library sources
Dependents: frdm_kl05z_gpio_test
Fork of mbed-src by
Diff: targets/hal/TARGET_STM/TARGET_DISCO_F303VC/us_ticker.c
- Revision:
- 304:89b9c3a9a045
- Parent:
- 157:90e3acc479a2
diff -r 78e31413b129 -r 89b9c3a9a045 targets/hal/TARGET_STM/TARGET_DISCO_F303VC/us_ticker.c --- a/targets/hal/TARGET_STM/TARGET_DISCO_F303VC/us_ticker.c Fri Aug 29 11:45:07 2014 +0100 +++ b/targets/hal/TARGET_STM/TARGET_DISCO_F303VC/us_ticker.c Fri Aug 29 17:15:07 2014 +0100 @@ -48,7 +48,7 @@ // Configure time base TIM_TimeBaseStructInit(&TIM_TimeBaseStructure); TIM_TimeBaseStructure.TIM_Period = 0xFFFFFFFF; - TIM_TimeBaseStructure.TIM_Prescaler = (uint16_t)(SystemCoreClock / 1000000) - 1; // 1 µs tick + TIM_TimeBaseStructure.TIM_Prescaler = (uint16_t)(SystemCoreClock / 1000000) - 1; // 1 �s tick TIM_TimeBaseStructure.TIM_ClockDivision = 0; TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; TIM_TimeBaseInit(TIM_MST, &TIM_TimeBaseStructure); @@ -65,9 +65,9 @@ return TIM_MST->CNT; } -void us_ticker_set_interrupt(unsigned int timestamp) { +void us_ticker_set_interrupt(timestamp_t timestamp) { // Set new output compare value - TIM_SetCompare1(TIM_MST, timestamp); + TIM_SetCompare1(TIM_MST, (uint32_t)timestamp); // Enable IT TIM_ITConfig(TIM_MST, TIM_IT_CC1, ENABLE); }