check if trans controller was initialized

This commit is contained in:
David Holdeman 2024-04-09 19:17:56 -05:00 committed by rusefillc
parent f458e057f8
commit 201e3d27d7
1 changed files with 8 additions and 3 deletions

View File

@ -28,9 +28,14 @@ void GearControllerBase::update() {
} else if (transmissionController->getMode() != engineConfiguration->transmissionControllerMode) { } else if (transmissionController->getMode() != engineConfiguration->transmissionControllerMode) {
initTransmissionController(); initTransmissionController();
} }
// We are responsible for telling the transmission controller
// what gear we want. // check if it was init'd (it wouldn't be if set to NONE)
transmissionController->update(getDesiredGear()); if (transmissionController != NULL) {
// We are responsible for telling the transmission controller
// what gear we want.
transmissionController->update(getDesiredGear());
}
// Post state to TS // Post state to TS
postState(); postState();
} }