Replace HAL_GetTick

pull/7228/head
bcostm 2018-05-25 15:54:22 +02:00 committed by adbridge
parent b80471a005
commit f3ea877f3a
3 changed files with 7 additions and 6 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;
}