avoid float -> int64 conversion #1977

both cases have to be relatively small durations of time cherry picking...
This commit is contained in:
rusefillc 2020-12-03 13:32:01 -05:00
parent ba33a758e8
commit 662eaea384
1 changed files with 3 additions and 2 deletions

View File

@ -250,8 +250,9 @@ size_t getMultiSparkCount(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
floatus_t multiDelay = CONFIG(multisparkSparkDuration);
floatus_t multiDwell = CONFIG(multisparkDwell);
ENGINE(engineState.multispark.delay) = US2NT(multiDelay);
ENGINE(engineState.multispark.dwell) = US2NT(multiDwell);
// dwell times are below 10 seconds here so we use 32 bit type for performance reasons
ENGINE(engineState.multispark.delay) = (uint32_t)USF2NT(multiDelay);
ENGINE(engineState.multispark.dwell) = (uint32_t)USF2NT(multiDwell);
constexpr float usPerDegreeAt1Rpm = 60e6 / 360;
floatus_t usPerDegree = usPerDegreeAt1Rpm / rpm;