From 405bf34cc153188975b9b1da34f80a716967baea Mon Sep 17 00:00:00 2001 From: BogGyver Date: Mon, 25 Nov 2019 08:55:44 -0500 Subject: [PATCH] force standard CC if pedal present --- selfdrive/car/tesla/carstate.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/selfdrive/car/tesla/carstate.py b/selfdrive/car/tesla/carstate.py index c856b6f458d906..0326a3227c3e6b 100644 --- a/selfdrive/car/tesla/carstate.py +++ b/selfdrive/car/tesla/carstate.py @@ -415,8 +415,8 @@ def __init__(self, CP): self.ahbHiBeamOn = 0 self.ahbNightMode = 0 - def config_ui_buttons(self, pedalPresent): - if pedalPresent: + def config_ui_buttons(self, pedalAvailable, pedalPresent): + if pedalAvailable: self.btns_init[1] = [PCCModes.BUTTON_NAME, PCCModes.BUTTON_ABREVIATION, PCCModes.labels()] else: # we don't have pedal interceptor @@ -426,7 +426,9 @@ def config_ui_buttons(self, pedalPresent): btn.btn_label = self.btns_init[1][1] btn.btn_label2 = self.btns_init[1][2][0] btn.btn_status = 1 - self.cstm_btns.update_ui_buttons(1, 1) + if (not pedalAvailable) and pedalPresent: + btn.btn_label2 = self.btns_init[1][2][1] + self.cstm_btns.update_ui_buttons(1, 1) def compute_speed(self): # if one of them is zero, select max of the two @@ -667,7 +669,7 @@ def update(self, cp, epas_cp, pedal_cp): # Mark pedal unavailable while traditional cruise is on. self.pedal_interceptor_available = pedal_interceptor_present and (self.forcePedalOverCC or not bool(self.pcm_acc_status)) if self.pedal_interceptor_available != self.prev_pedal_interceptor_available: - self.config_ui_buttons(self.pedal_interceptor_available) + self.config_ui_buttons(self.pedal_interceptor_available, pedal_interceptor_present) self.v_cruise_actual = self.DI_cruiseSet self.hud_lead = 0 #JCT