From 00b6be2f5f5aaa5af92d420d34383415b629a838 Mon Sep 17 00:00:00 2001 From: Jamezz Date: Thu, 23 Aug 2018 18:39:11 -0700 Subject: [PATCH] Volt: Don't adjust speed on resume from stopped (#325) * Don't adjust speed if resuming * Detab old-commit-hash: c29b311583e701c939bd3115957200f378988021 --- selfdrive/car/gm/interface.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py index 3d0a49feee..bf39272fc4 100755 --- a/selfdrive/car/gm/interface.py +++ b/selfdrive/car/gm/interface.py @@ -194,7 +194,8 @@ class CarInterface(object): # cruise state ret.cruiseState.available = bool(self.CS.main_on) - ret.cruiseState.enabled = self.CS.pcm_acc_status != 0 + cruiseEnabled = self.CS.pcm_acc_status != 0 + ret.cruiseState.enabled = cruiseEnabled ret.cruiseState.standstill = self.CS.pcm_acc_status == 4 ret.leftBlinker = self.CS.left_blinker_on @@ -228,7 +229,8 @@ class CarInterface(object): be.pressed = False but = self.CS.prev_cruise_buttons if but == CruiseButtons.RES_ACCEL: - be.type = 'accelCruise' + if not (cruiseEnabled and self.CS.standstill): + be.type = 'accelCruise' # Suppress resume button if we're resuming from stop so we don't adjust speed. elif but == CruiseButtons.DECEL_SET: be.type = 'decelCruise' elif but == CruiseButtons.CANCEL: