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.
Dependents: STM32L452_Nucleo_ticker
Fork of mbed-dev by
Diff: targets/TARGET_STM/us_ticker_32b.c
- Revision:
- 167:e84263d55307
- Parent:
- 153:fa9ff456f731
- Child:
- 168:9672193075cf
--- a/targets/TARGET_STM/us_ticker_32b.c Thu Jun 08 15:02:37 2017 +0100
+++ b/targets/TARGET_STM/us_ticker_32b.c Wed Jun 21 17:46:44 2017 +0100
@@ -48,6 +48,10 @@
__HAL_TIM_SET_COMPARE(&TimMasterHandle, TIM_CHANNEL_1, (uint32_t)timestamp);
// Enable IT
__HAL_TIM_ENABLE_IT(&TimMasterHandle, TIM_IT_CC1);
+ // Check if timestamp has already passed, and if so, set the event immediately
+ if ((int32_t)(timestamp - TIM_MST->CNT) <= 0) {
+ LL_TIM_GenerateEvent_CC1(TimMasterHandle.Instance);
+ }
}
void us_ticker_disable_interrupt(void)
