diff --git a/firmware/controllers/actuators/alternator_controller.cpp b/firmware/controllers/actuators/alternator_controller.cpp index 7c839a13c8..5f34b69b92 100644 --- a/firmware/controllers/actuators/alternator_controller.cpp +++ b/firmware/controllers/actuators/alternator_controller.cpp @@ -77,7 +77,7 @@ void AlternatorController::setOutput(expected outputValue) { } void AlternatorController::onConfigurationChange(engine_configuration_s const * previousConfiguration) { - if(!alternatorPid.isSame(&previousConfiguration->alternatorControl)) { + if(!previousConfiguration || !alternatorPid.isSame(&previousConfiguration->alternatorControl)) { alternatorPid.reset(); } } diff --git a/firmware/controllers/actuators/boost_control.cpp b/firmware/controllers/actuators/boost_control.cpp index e798abe55a..7b067f0f56 100644 --- a/firmware/controllers/actuators/boost_control.cpp +++ b/firmware/controllers/actuators/boost_control.cpp @@ -39,7 +39,7 @@ void BoostController::resetLua() { } void BoostController::onConfigurationChange(engine_configuration_s const * previousConfig) { - if (!m_pid.isSame(&previousConfig->boostPid)) { + if (!previousConfig || !m_pid.isSame(&previousConfig->boostPid)) { m_shouldResetPid = true; } } diff --git a/firmware/controllers/actuators/idle_thread.cpp b/firmware/controllers/actuators/idle_thread.cpp index bb1ab38b12..2a33ab88dc 100644 --- a/firmware/controllers/actuators/idle_thread.cpp +++ b/firmware/controllers/actuators/idle_thread.cpp @@ -376,7 +376,7 @@ void IdleController::onSlowCallback() { void IdleController::onConfigurationChange(engine_configuration_s const * previousConfiguration) { #if ! EFI_UNIT_TEST - shouldResetPid = !getIdlePid()->isSame(&previousConfiguration->idleRpmPid); + shouldResetPid = !previousConfig || !getIdlePid()->isSame(&previousConfiguration->idleRpmPid); mustResetPid = shouldResetPid; #endif } diff --git a/firmware/controllers/actuators/vvt.cpp b/firmware/controllers/actuators/vvt.cpp index 4059645240..e08c5ae50b 100644 --- a/firmware/controllers/actuators/vvt.cpp +++ b/firmware/controllers/actuators/vvt.cpp @@ -42,7 +42,7 @@ void VvtController::onFastCallback() { } void VvtController::onConfigurationChange(engine_configuration_s const * previousConfig) { - if (!m_pid.isSame(&previousConfig->auxPid[m_cam])) { + if (!previousConfig || !m_pid.isSame(&previousConfig->auxPid[m_cam])) { m_pid.reset(); } }