mbed
Fork of mbed-dev by
Diff: targets/TARGET_STM/hal_tick_16b.c
- Revision:
- 165:e614a9f1c9e2
- Parent:
- 156:95d6b41a828b
- Child:
- 167:e84263d55307
--- a/targets/TARGET_STM/hal_tick_16b.c Wed May 10 12:06:41 2017 +0100 +++ b/targets/TARGET_STM/hal_tick_16b.c Fri May 26 12:39:01 2017 +0100 @@ -84,12 +84,12 @@ if (__HAL_TIM_GET_FLAG(&TimMasterHandle, TIM_FLAG_CC2) == SET) { if (__HAL_TIM_GET_IT_SOURCE(&TimMasterHandle, TIM_IT_CC2) == SET) { __HAL_TIM_CLEAR_IT(&TimMasterHandle, TIM_IT_CC2); - uint32_t val = __HAL_TIM_GetCounter(&TimMasterHandle); + uint32_t val = __HAL_TIM_GET_COUNTER(&TimMasterHandle); if ((val - PreviousVal) >= HAL_TICK_DELAY) { // Increment HAL variable HAL_IncTick(); // Prepare next interrupt - __HAL_TIM_SetCompare(&TimMasterHandle, TIM_CHANNEL_2, val + HAL_TICK_DELAY); + __HAL_TIM_SET_COMPARE(&TimMasterHandle, TIM_CHANNEL_2, val + HAL_TICK_DELAY); PreviousVal = val; #if DEBUG_TICK > 0 HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_6); @@ -128,8 +128,8 @@ // Configure output compare channel 2 for HAL tick HAL_TIM_OC_Start(&TimMasterHandle, TIM_CHANNEL_2); - PreviousVal = __HAL_TIM_GetCounter(&TimMasterHandle); - __HAL_TIM_SetCompare(&TimMasterHandle, TIM_CHANNEL_2, PreviousVal + HAL_TICK_DELAY); + PreviousVal = __HAL_TIM_GET_COUNTER(&TimMasterHandle); + __HAL_TIM_SET_COMPARE(&TimMasterHandle, TIM_CHANNEL_2, PreviousVal + HAL_TICK_DELAY); // Configure interrupts // Update interrupt used for 32-bit counter @@ -155,7 +155,7 @@ HAL_TIM_Base_Start(&TimMasterHandle); #if DEBUG_TICK > 0 - __GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); GPIO_InitTypeDef GPIO_InitStruct; GPIO_InitStruct.Pin = GPIO_PIN_6; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;