Fix uninitialized state handling (#939)
This commit is contained in:
@@ -367,7 +367,7 @@ void transportSwitchSM(transportState_t& newState)
|
|||||||
} else {
|
} else {
|
||||||
_transportSM.stateRetries++; // increment retries
|
_transportSM.stateRetries++; // increment retries
|
||||||
}
|
}
|
||||||
if (_transportSM.currentState->Transition) {
|
if (_transportSM.currentState) {
|
||||||
_transportSM.currentState->Transition(); // State transition
|
_transportSM.currentState->Transition(); // State transition
|
||||||
}
|
}
|
||||||
_transportSM.stateEnter = hwMillis(); // save time
|
_transportSM.stateEnter = hwMillis(); // save time
|
||||||
@@ -380,7 +380,7 @@ uint32_t transportTimeInState(void)
|
|||||||
|
|
||||||
void transportUpdateSM(void)
|
void transportUpdateSM(void)
|
||||||
{
|
{
|
||||||
if (_transportSM.currentState->Update) {
|
if (_transportSM.currentState) {
|
||||||
_transportSM.currentState->Update();
|
_transportSM.currentState->Update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user