avoid float -> int64 conversion #1977
both cases have to be relatively small durations of time cherry picking...
This commit is contained in:
parent
f1f64bd3e5
commit
ba33a758e8
|
@ -386,7 +386,8 @@ efitick_t scheduleByAngle(scheduling_s *timer, efitick_t edgeTimestamp, angle_t
|
|||
action_s action DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
float delayUs = ENGINE(rpmCalculator.oneDegreeUs) * angle;
|
||||
|
||||
efitime_t delayNt = US2NT(delayUs);
|
||||
// 'delayNt' is below 10 seconds here so we use 32 bit type for performance reasons
|
||||
int32_t delayNt = USF2NT(delayUs);
|
||||
efitime_t delayedTime = edgeTimestamp + delayNt;
|
||||
|
||||
ENGINE(executor.scheduleByTimestampNt(timer, delayedTime, action));
|
||||
|
|
|
@ -136,8 +136,9 @@ void PwmConfig::setFrequency(float frequency) {
|
|||
}
|
||||
/**
|
||||
* see #handleCycleStart()
|
||||
* 'periodNt' is below 10 seconds here so we use 32 bit type for performance reasons
|
||||
*/
|
||||
periodNt = US2NT(frequency2periodUs(frequency));
|
||||
periodNt = USF2NT(frequency2periodUs(frequency));
|
||||
}
|
||||
|
||||
void PwmConfig::stop() {
|
||||
|
|
Loading…
Reference in New Issue