From 7ca4a582d5170f2ec79a1f1826a7d040ab6d1d96 Mon Sep 17 00:00:00 2001 From: James <91348155+FrogAi@users.noreply.github.com> Date: Mon, 1 Dec 2025 12:00:00 -0700 Subject: [PATCH] Reverse cruise increase for Toyota/Lexus --- opendbc_repo/opendbc/car/toyota/carcontroller.py | 4 ++-- opendbc_repo/opendbc/car/toyota/toyotacan.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/opendbc_repo/opendbc/car/toyota/carcontroller.py b/opendbc_repo/opendbc/car/toyota/carcontroller.py index 1446c724..379734d7 100644 --- a/opendbc_repo/opendbc/car/toyota/carcontroller.py +++ b/opendbc_repo/opendbc/car/toyota/carcontroller.py @@ -279,7 +279,7 @@ class CarController(CarControllerBase): main_accel_cmd = 0. if self.CP.flags & ToyotaFlags.SECOC.value else pcm_accel_cmd can_sends.append(toyotacan.create_accel_command(self.packer, main_accel_cmd, pcm_cancel_cmd, self.permit_braking, self.standstill_req, lead, - CS.acc_type, fcw_alert, self.distance_button)) + CS.acc_type, fcw_alert, self.distance_button, frogpilot_toggles.reverse_cruise_increase)) if self.CP.flags & ToyotaFlags.SECOC.value: acc_cmd_2 = toyotacan.create_accel_command_2(self.packer, pcm_accel_cmd) acc_cmd_2 = add_mac(self.secoc_key, @@ -298,7 +298,7 @@ class CarController(CarControllerBase): if self.CP.carFingerprint in UNSUPPORTED_DSU_CAR: can_sends.append(toyotacan.create_acc_cancel_command(self.packer)) else: - can_sends.append(toyotacan.create_accel_command(self.packer, 0, pcm_cancel_cmd, True, False, lead, CS.acc_type, False, self.distance_button)) + can_sends.append(toyotacan.create_accel_command(self.packer, 0, pcm_cancel_cmd, True, False, lead, CS.acc_type, False, self.distance_button, frogpilot_toggles.reverse_cruise_increase)) # *** hud ui *** if self.CP.carFingerprint != CAR.TOYOTA_PRIUS_V: diff --git a/opendbc_repo/opendbc/car/toyota/toyotacan.py b/opendbc_repo/opendbc/car/toyota/toyotacan.py index b8878514..d4771a77 100644 --- a/opendbc_repo/opendbc/car/toyota/toyotacan.py +++ b/opendbc_repo/opendbc/car/toyota/toyotacan.py @@ -40,7 +40,7 @@ def create_lta_steer_command_2(packer, frame): return packer.make_can_msg("STEERING_LTA_2", 0, values) -def create_accel_command(packer, accel, pcm_cancel, permit_braking, standstill_req, lead, acc_type, fcw_alert, distance): +def create_accel_command(packer, accel, pcm_cancel, permit_braking, standstill_req, lead, acc_type, fcw_alert, distance, reverse_cruise_active): # TODO: find the exact canceling bit that does not create a chime values = { "ACCEL_CMD": accel, @@ -50,7 +50,7 @@ def create_accel_command(packer, accel, pcm_cancel, permit_braking, standstill_r "PERMIT_BRAKING": permit_braking, "RELEASE_STANDSTILL": not standstill_req, "CANCEL_REQ": pcm_cancel, - "ALLOW_LONG_PRESS": 1, + "ALLOW_LONG_PRESS": 2 if reverse_cruise_active else 1, "ACC_CUT_IN": fcw_alert, # only shown when ACC enabled } return packer.make_can_msg("ACC_CONTROL", 0, values)