Increase max speed by 5 on short press

Added function to increase the value of the max speed by 5 instead of 1 by taping the "Max" speed icon in the onroad UI.
This commit is contained in:
FrogAi
2024-01-12 22:39:30 -07:00
parent f4caa201cc
commit 72fac6ed9d
7 changed files with 40 additions and 14 deletions

View File

@@ -33,7 +33,7 @@ def create_lta_steer_command(packer, steer_control_type, steer_angle, steer_req,
return packer.make_can_msg("STEERING_LTA", 0, values)
def create_accel_command(packer, accel, pcm_cancel, standstill_req, lead, acc_type, fcw_alert):
def create_accel_command(packer, accel, pcm_cancel, standstill_req, lead, acc_type, fcw_alert, reverse_cruise):
# TODO: find the exact canceling bit that does not create a chime
values = {
"ACCEL_CMD": accel,
@@ -43,7 +43,7 @@ def create_accel_command(packer, accel, pcm_cancel, standstill_req, lead, acc_ty
"PERMIT_BRAKING": 1,
"RELEASE_STANDSTILL": not standstill_req,
"CANCEL_REQ": pcm_cancel,
"ALLOW_LONG_PRESS": 1,
"ALLOW_LONG_PRESS": 2 if reverse_cruise else 1,
"ACC_CUT_IN": fcw_alert, # only shown when ACC enabled
}
return packer.make_can_msg("ACC_CONTROL", 0, values)