You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
351 B
18 lines
351 B
#include "tick.h"
|
|
#include "main.h"
|
|
#include <stdint.h>
|
|
/**
|
|
* @description:
|
|
* @param {uint32_t} lastime
|
|
* @return {*}
|
|
*/
|
|
uint32_t pass_time(uint32_t lastime) {
|
|
uint32_t nowtime = HAL_GetTick();
|
|
int32_t passtime;
|
|
passtime = nowtime - lastime;
|
|
|
|
if (passtime >= 0)
|
|
return passtime;
|
|
else
|
|
return HAL_MAX_DELAY - lastime + nowtime;
|
|
}
|