Nfc: switch to HAL ticks. ApiHal: small cleanup and refactoring. (#609)

This commit is contained in:
あく
2021-07-28 11:45:42 +03:00
committed by GitHub
parent 4c1ac2a13d
commit 1c58de24f5
21 changed files with 36 additions and 41 deletions

View File

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