avoid long -> float

This commit is contained in:
Matthew Kennedy 2024-05-11 13:19:03 -07:00
parent c853beee1f
commit d1d10f8a56
2 changed files with 2 additions and 2 deletions

View File

@ -256,7 +256,7 @@ float IdleController::getClosedLoop(IIdleController::Phase phase, float tpsPos,
}
// increase the errorAmpCoef slowly to restore the process correctly after the PID reset
// todo: move restoreAfterPidResetTimeUs to idle?
efitimeus_t timeSincePidResetUs = nowUs - restoreAfterPidResetTimeUs;
int32_t timeSincePidResetUs = nowUs - restoreAfterPidResetTimeUs;
// todo: add 'pidAfterResetDampingPeriodMs' setting
errorAmpCoef = interpolateClamped(0, 0, MS2US(/*engineConfiguration->pidAfterResetDampingPeriodMs*/1000), errorAmpCoef, timeSincePidResetUs);
// If errorAmpCoef > 1.0, then PID thinks that RPM is lower than it is, and controls IAC more aggressively

View File

@ -60,7 +60,7 @@ void DynoView::update(vssSrc src) {
*/
void DynoView::updateAcceleration(efitimeus_t deltaTime, float deltaSpeed) {
if (deltaSpeed != 0.0) {
acceleration = ((deltaSpeed / 3.6) / (deltaTime / US_PER_SECOND_F));
acceleration = ((deltaSpeed / 3.6) / ((uint32_t)deltaTime / US_PER_SECOND_F));
if (direction) {
//decceleration
acceleration *= -1;