Handle USB reconnect while out of park
This commit is contained in:
@@ -109,6 +109,12 @@ void setup() {
|
||||
confirmedDriveMode = getRawDriveMode();
|
||||
pendingDriveMode = confirmedDriveMode;
|
||||
targetPosMs = getTargetForConfirmedMode();
|
||||
if (confirmedDriveMode == HIGH) {
|
||||
// USB serial reconnect can reset the board while the car is already out of P.
|
||||
// In that case, assume the seat is already at the saved driving position.
|
||||
currentPosMs = storedSeatPositionMs;
|
||||
targetPosMs = storedSeatPositionMs;
|
||||
}
|
||||
if (ignitionState == LOW) {
|
||||
ignitionOffStartTime = millis();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user