common getTimeNowUs

This commit is contained in:
Matthew Kennedy 2024-04-25 22:01:46 -07:00
parent be2c04813a
commit decbaaef4a
2 changed files with 3 additions and 7 deletions

View File

@ -11,6 +11,8 @@ efitick_t getTimeNowNt() {
return timeNt.update(getTimeNowLowerNt());
}
#endif /* !EFI_UNIT_TEST */
/**
* 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());
}
#endif /* !EFI_UNIT_TEST */
/**
* Integer number of seconds since ECU boot.
* 31,710 years - would not overflow during our life span.

View File

@ -11,12 +11,8 @@ bool verboseMode = false;
int timeNowUs = 0;
efitimeus_t getTimeNowUs() {
return timeNowUs;
}
efitick_t getTimeNowNt() {
return getTimeNowUs() * US_TO_NT_MULTIPLIER;
return (efitimeus_t)timeNowUs * US_TO_NT_MULTIPLIER;
}
void initLogging(LoggingWithStorage *logging, const char *name) {