auto-sync
This commit is contained in:
parent
9ac2d65a66
commit
82f2b8670b
|
@ -20,6 +20,17 @@
|
|||
*/
|
||||
typedef uint32_t efitimems_t;
|
||||
|
||||
/**
|
||||
* 64 bit time in microseconds, since boot
|
||||
*/
|
||||
typedef uint64_t efitimeus_t;
|
||||
|
||||
/**
|
||||
* platform-dependent tick since boot
|
||||
* in case of stm32f4 that's a CPU tick
|
||||
*/
|
||||
typedef uint64_t efitick_t;
|
||||
|
||||
/**
|
||||
* numeric value from 0 to 100
|
||||
*/
|
||||
|
@ -49,12 +60,12 @@ extern "C"
|
|||
* WARNING: you should use getTimeNowNt where possible for performance reasons.
|
||||
* The heaviest part is '__aeabi_ildivmod' - non-native 64 bit division
|
||||
*/
|
||||
uint64_t getTimeNowUs(void);
|
||||
efitimeus_t getTimeNowUs(void);
|
||||
|
||||
/**
|
||||
* 64-bit counter CPU cycles since MCU reset
|
||||
*/
|
||||
uint64_t getTimeNowNt(void);
|
||||
efitick_t getTimeNowNt(void);
|
||||
|
||||
uint64_t getHalTimer(void);
|
||||
|
||||
|
|
|
@ -40,9 +40,15 @@ extern "C"
|
|||
// 168 ticks in microsecond
|
||||
#define US_TO_NT_MULTIPLIER 168
|
||||
|
||||
#define US2NT(x) (((uint64_t)(x))*US_TO_NT_MULTIPLIER)
|
||||
/**
|
||||
* converts efitimeus_t to efitick_t
|
||||
*/
|
||||
#define US2NT(us) (((uint64_t)(us))*US_TO_NT_MULTIPLIER)
|
||||
|
||||
#define NT2US(x) ((x) / US_TO_NT_MULTIPLIER)
|
||||
/**
|
||||
* converts efitick_t to efitimeus_t
|
||||
*/
|
||||
#define NT2US(nt) ((nt) / US_TO_NT_MULTIPLIER)
|
||||
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue