Skip to content

Commit

Permalink
Merge pull request commaai#137 from CT921/patch_ap_btn_link
Browse files Browse the repository at this point in the history
Fix toyota_ap_btn_link on TSS1
  • Loading branch information
rav4kumar committed Apr 18, 2022
2 parents 90b7238 + b849abc commit 08988f8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions selfdrive/car/toyota/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,18 @@ def update(self, cp, cp_cam):
if self.CP.carFingerprint in TSS2_CAR:
sport_on = cp.vl["GEAR_PACKET"]['SPORT_ON']
econ_on = cp.vl["GEAR_PACKET"]['ECON_ON']
if self.CP.carFingerprint == CAR.RAV4_TSS2:
sport_on = cp.vl["GEAR_PACKET"]['SPORT_ON_2']
else:
try:
sport_on = cp.vl["GEAR_PACKET"]['SPORT_ON']
econ_on = cp.vl["GEAR_PACKET"]['ECON_ON']
except KeyError:
sport_on = 0
econ_on = 0
if self.CP.carFingerprint == CAR.RAV4_TSS2:
sport_on = cp.vl["GEAR_PACKET"]['SPORT_ON_2']
else:
try:
sport_on = cp.vl["GEAR_PACKET"]['SPORT_ON']
except KeyError:
sport_on = 0
if sport_on == 0 and econ_on == 0:
self.dp_accel_profile = DP_ACCEL_NORMAL
elif sport_on == 1:
Expand Down

0 comments on commit 08988f8

Please sign in to comment.