Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-src by
Diff: targets/hal/TARGET_STM/TARGET_NUCLEO_F302R8/us_ticker.c
- Revision:
- 304:89b9c3a9a045
- Parent:
- 135:067cc8ba23da
- Child:
- 330:c80ac197fa6a
--- a/targets/hal/TARGET_STM/TARGET_NUCLEO_F302R8/us_ticker.c Fri Aug 29 11:45:07 2014 +0100 +++ b/targets/hal/TARGET_STM/TARGET_NUCLEO_F302R8/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); }