mirror of https://github.com/ARMmbed/mbed-os.git
Replace HAL_GetTick
parent
b80471a005
commit
f3ea877f3a
|
@ -57,8 +57,6 @@ void timer_oc_irq_handler(void)
|
|||
__HAL_TIM_CLEAR_IT(&TimMasterHandle, TIM_IT_CC2);
|
||||
uint32_t val = __HAL_TIM_GET_COUNTER(&TimMasterHandle);
|
||||
if ((val - PreviousVal) >= HAL_TICK_DELAY) {
|
||||
// Increment HAL variable
|
||||
HAL_IncTick();
|
||||
// Prepare next interrupt
|
||||
__HAL_TIM_SET_COMPARE(&TimMasterHandle, TIM_CHANNEL_2, val + HAL_TICK_DELAY);
|
||||
PreviousVal = val;
|
||||
|
|
|
@ -22,8 +22,6 @@
|
|||
|
||||
extern TIM_HandleTypeDef TimMasterHandle;
|
||||
|
||||
extern void HAL_IncTick(void);
|
||||
|
||||
volatile uint32_t PreviousVal = 0;
|
||||
|
||||
void us_ticker_irq_handler(void);
|
||||
|
@ -44,8 +42,6 @@ void timer_irq_handler(void)
|
|||
__HAL_TIM_CLEAR_IT(&TimMasterHandle, TIM_IT_CC2);
|
||||
uint32_t val = __HAL_TIM_GET_COUNTER(&TimMasterHandle);
|
||||
if ((val - PreviousVal) >= HAL_TICK_DELAY) {
|
||||
// Increment HAL variable
|
||||
HAL_IncTick();
|
||||
// Prepare next interrupt
|
||||
__HAL_TIM_SET_COMPARE(&TimMasterHandle, TIM_CHANNEL_2, val + HAL_TICK_DELAY);
|
||||
PreviousVal = val;
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
#include "hal/us_ticker_api.h"
|
||||
|
||||
// Overwrite default HAL function
|
||||
uint32_t HAL_GetTick()
|
||||
{
|
||||
return ticker_read_us(get_us_ticker_data()) / 1000;
|
||||
}
|
Loading…
Reference in New Issue