mirror of https://github.com/FOME-Tech/fome-fw.git
common getTimeNowUs
This commit is contained in:
parent
be2c04813a
commit
decbaaef4a
|
@ -11,6 +11,8 @@ efitick_t getTimeNowNt() {
|
||||||
return timeNt.update(getTimeNowLowerNt());
|
return timeNt.update(getTimeNowLowerNt());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* !EFI_UNIT_TEST */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 64-bit result would not overflow, but that's complex stuff for our 32-bit MCU
|
* 64-bit result would not overflow, but that's complex stuff for our 32-bit MCU
|
||||||
*/
|
*/
|
||||||
|
@ -19,8 +21,6 @@ efitimeus_t getTimeNowUs() {
|
||||||
return NT2US(getTimeNowNt());
|
return NT2US(getTimeNowNt());
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* !EFI_UNIT_TEST */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Integer number of seconds since ECU boot.
|
* Integer number of seconds since ECU boot.
|
||||||
* 31,710 years - would not overflow during our life span.
|
* 31,710 years - would not overflow during our life span.
|
||||||
|
|
|
@ -11,12 +11,8 @@ bool verboseMode = false;
|
||||||
|
|
||||||
int timeNowUs = 0;
|
int timeNowUs = 0;
|
||||||
|
|
||||||
efitimeus_t getTimeNowUs() {
|
|
||||||
return timeNowUs;
|
|
||||||
}
|
|
||||||
|
|
||||||
efitick_t getTimeNowNt() {
|
efitick_t getTimeNowNt() {
|
||||||
return getTimeNowUs() * US_TO_NT_MULTIPLIER;
|
return (efitimeus_t)timeNowUs * US_TO_NT_MULTIPLIER;
|
||||||
}
|
}
|
||||||
|
|
||||||
void initLogging(LoggingWithStorage *logging, const char *name) {
|
void initLogging(LoggingWithStorage *logging, const char *name) {
|
||||||
|
|
Loading…
Reference in New Issue