mbed library sources
Dependents: Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more
Superseded
This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.
Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.
If you are looking for a stable and tested release, please import one of the official mbed library releases:
Import librarymbed
The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Diff: targets/hal/TARGET_STM/TARGET_NUCLEO_F072RB/us_ticker.c
- Revision:
- 431:255afbe6270c
- Parent:
- 404:cbc7dfcb0ce9
--- a/targets/hal/TARGET_STM/TARGET_NUCLEO_F072RB/us_ticker.c Tue Dec 09 14:30:09 2014 +0000 +++ b/targets/hal/TARGET_STM/TARGET_NUCLEO_F072RB/us_ticker.c Tue Dec 09 14:45:08 2014 +0000 @@ -30,9 +30,7 @@ #include "PeripheralNames.h" // 32-bit timer selection -#define TIM_MST TIM2 -#define TIM_MST_IRQ TIM2_IRQn -#define TIM_MST_RCC __TIM2_CLK_ENABLE() +#define TIM_MST TIM2 static TIM_HandleTypeDef TimMasterHandle; static int us_ticker_inited = 0; @@ -42,26 +40,9 @@ if (us_ticker_inited) return; us_ticker_inited = 1; - // Update the SystemCoreClock variable - SystemCoreClockUpdate(); - - // Enable timer clock - TIM_MST_RCC; + TimMasterHandle.Instance = TIM_MST; - // Configure time base - TimMasterHandle.Instance = TIM_MST; - TimMasterHandle.Init.Period = 0xFFFFFFFF; - TimMasterHandle.Init.Prescaler = (uint32_t)(SystemCoreClock / 1000000) - 1; // 1 us tick - TimMasterHandle.Init.ClockDivision = 0; - TimMasterHandle.Init.CounterMode = TIM_COUNTERMODE_UP; - TimMasterHandle.Init.RepetitionCounter = 0; - HAL_TIM_OC_Init(&TimMasterHandle); - - NVIC_SetVector(TIM_MST_IRQ, (uint32_t)us_ticker_irq_handler); - NVIC_EnableIRQ(TIM_MST_IRQ); - - // Enable timer - HAL_TIM_OC_Start(&TimMasterHandle, TIM_CHANNEL_1); + HAL_InitTick(0); // The passed value is not used } uint32_t us_ticker_read()