From 7dbc9afa38de459afd379b56ea707e6b9b7f120b Mon Sep 17 00:00:00 2001 From: rusefillc Date: Thu, 3 Dec 2020 10:31:16 -0500 Subject: [PATCH] Avoid float -> int64 conversion #1993 --- firmware/util/efitime.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/firmware/util/efitime.h b/firmware/util/efitime.h index c582b83b46..e20fe35742 100644 --- a/firmware/util/efitime.h +++ b/firmware/util/efitime.h @@ -20,6 +20,8 @@ #define MS2US(MS_TIME) ((MS_TIME) * 1000) // microseconds to ticks +// since only about 20 seconds of ticks fit in 32 bits this macro is casting parameter into 64 bits 'efitime_t' type +// please note that int64 <-> float is a heavy operation thus we have 'USF2NT' below #define US2NT(us) (((efitime_t)(us)) * US_TO_NT_MULTIPLIER) // microseconds to ticks, but floating point