mbed library sources
Dependents: frdm_kl05z_gpio_test
Fork of mbed-src by
Diff: targets/hal/TARGET_STM/TARGET_DISCO_F100RB/us_ticker.c
- Revision:
- 304:89b9c3a9a045
- Parent:
- 126:549ba18ddd81
--- a/targets/hal/TARGET_STM/TARGET_DISCO_F100RB/us_ticker.c Fri Aug 29 11:45:07 2014 +0100 +++ b/targets/hal/TARGET_STM/TARGET_DISCO_F100RB/us_ticker.c Fri Aug 29 17:15:07 2014 +0100 @@ -92,7 +92,7 @@ // Configure time base TIM_TimeBaseStructInit(&TIM_TimeBaseStructure); TIM_TimeBaseStructure.TIM_Period = 0xFFFF; - 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); @@ -133,8 +133,8 @@ return counter2; } -void us_ticker_set_interrupt(unsigned int timestamp) { - int delta = (int)(timestamp - us_ticker_read()); +void us_ticker_set_interrupt(timestamp_t timestamp) { + int delta = (int)((uint32_t)timestamp - us_ticker_read()); uint16_t cval = TIM_MST->CNT; if (delta <= 0) { // This event was in the past