diff --git a/firmware/util/efitime.cpp b/firmware/util/efitime.cpp index 6f3d26b659..9134531763 100644 --- a/firmware/util/efitime.cpp +++ b/firmware/util/efitime.cpp @@ -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. diff --git a/unit_tests/global_mocks.cpp b/unit_tests/global_mocks.cpp index e8ac0f3519..9d966f7d35 100644 --- a/unit_tests/global_mocks.cpp +++ b/unit_tests/global_mocks.cpp @@ -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) {