Nfc: switch to HAL ticks. ApiHal: small cleanup and refactoring. (#609)
This commit is contained in:
@@ -67,7 +67,7 @@ static uint32_t timerStopwatchTick;
|
||||
/*******************************************************************************/
|
||||
uint32_t timerCalculateTimer( uint16_t time )
|
||||
{
|
||||
return (osKernelGetTickCount() + time);
|
||||
return (HAL_GetTick() + time);
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ bool timerIsExpired( uint32_t timer )
|
||||
uint32_t uDiff;
|
||||
int32_t sDiff;
|
||||
|
||||
uDiff = (timer - osKernelGetTickCount()); /* Calculate the diff between the timers */
|
||||
uDiff = (timer - HAL_GetTick()); /* Calculate the diff between the timers */
|
||||
sDiff = uDiff; /* Convert the diff to a signed var */
|
||||
|
||||
/* Check if the given timer has expired already */
|
||||
@@ -104,13 +104,13 @@ void timerDelay( uint16_t tOut )
|
||||
/*******************************************************************************/
|
||||
void timerStopwatchStart( void )
|
||||
{
|
||||
timerStopwatchTick = osKernelGetTickCount();
|
||||
timerStopwatchTick = HAL_GetTick();
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
uint32_t timerStopwatchMeasure( void )
|
||||
{
|
||||
return (uint32_t)(osKernelGetTickCount() - timerStopwatchTick);
|
||||
return (uint32_t)(HAL_GetTick() - timerStopwatchTick);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user