Pull fixCommonParams and sendCommand out of driving modes

This commit is contained in:
Michael Ehrenreich
2022-06-23 00:06:50 +02:00
committed by CommanderRedYT
parent 5971061bc7
commit 3e70a1fc74
10 changed files with 5 additions and 31 deletions

View File

@ -21,4 +21,9 @@ void updateDrivingMode()
if (currentMode)
currentMode->update();
fixCommonParams();
// Last, send values to motor controllers
sendCommands();
}

View File

@ -258,8 +258,6 @@ void DefaultMode::update()
motor.cruiseCtrlEna = false;
motor.nCruiseMotTgt = 0;
}
fixCommonParams();
}
}
sendCommands();
}

View File

@ -76,9 +76,5 @@ void GametrakMode::update()
motor.nCruiseMotTgt = 0;
}
}
fixCommonParams();
sendCommands();
}
#endif

View File

@ -14,8 +14,4 @@ void IgnoreInputMode::update()
motor.cruiseCtrlEna = false;
motor.nCruiseMotTgt = 0;
}
fixCommonParams();
sendCommands();
}

View File

@ -105,8 +105,4 @@ void LarsmMode::update()
motor.nCruiseMotTgt = 0;
}
}
fixCommonParams();
sendCommands();
}

View File

@ -78,8 +78,4 @@ void MickMode::update()
motor.nCruiseMotTgt = 0;
}
}
fixCommonParams();
sendCommands();
}

View File

@ -34,7 +34,4 @@ void MotortestMode::update()
motor.cruiseCtrlEna = false;
motor.nCruiseMotTgt = 0;
}
fixCommonParams();
sendCommands();
}

View File

@ -42,10 +42,6 @@ void RemoteControlMode::update()
controllers.back.command.left.pwm = m_remoteCommand->backLeft;
controllers.back.command.right.pwm = m_remoteCommand->backRight;
}
fixCommonParams();
sendCommands();
}
void RemoteControlMode::setCommand(const RemoteCommand &command)

View File

@ -53,8 +53,4 @@ void TempomatMode::update()
motor.nCruiseMotTgt = nCruiseMotTgt;
}
}
fixCommonParams();
sendCommands();
}

View File

@ -219,9 +219,7 @@ void WheelchairMode::update()
controller.command.right.cruiseCtrlEna = false;
controller.command.right.nCruiseMotTgt = 0;
}
fixCommonParams();
}
}
sendCommands();
}
#endif