Ford: show FCW alert on IPC (#27924)

* Ford: show FCW alert on IPC

* forward fcw from ipma

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
old-commit-hash: 47f948c5c6a81d229d9ab74183f4bfe9fe8dc9fb
This commit is contained in:
Cameron Clough
2023-06-29 00:22:53 +01:00
committed by GitHub
parent be977ffe5b
commit c40c24e18d
2 changed files with 8 additions and 3 deletions
+2 -1
View File
@@ -43,6 +43,7 @@ class CarController:
main_on = CS.out.cruiseState.available
steer_alert = hud_control.visualAlert in (VisualAlert.steerRequired, VisualAlert.ldw)
fcw_alert = hud_control.visualAlert == VisualAlert.fcw
### acc buttons ###
if CC.cruiseControl.cancel:
@@ -100,7 +101,7 @@ class CarController:
# send acc ui msg at 5Hz or if ui state changes
if (self.frame % CarControllerParams.ACC_UI_STEP) == 0 or send_ui:
can_sends.append(create_acc_ui_msg(self.packer, self.CAN, self.CP, main_on, CC.latActive,
CS.out.cruiseState.standstill, hud_control,
fcw_alert, CS.out.cruiseState.standstill, hud_control,
CS.acc_tja_status_stock_values))
self.main_on_last = main_on
+6 -2
View File
@@ -142,8 +142,8 @@ def create_acc_msg(packer, CAN: CanBus, long_active: bool, gas: float, accel: fl
return packer.make_can_msg("ACCDATA", CAN.main, values)
def create_acc_ui_msg(packer, CAN: CanBus, CP, main_on: bool, enabled: bool, standstill: bool, hud_control,
stock_values: dict):
def create_acc_ui_msg(packer, CAN: CanBus, CP, main_on: bool, enabled: bool, fcw_alert: bool, standstill: bool,
hud_control, stock_values: dict):
"""
Creates a CAN message for the Ford IPC adaptive cruise, forward collision warning and traffic jam
assist status.
@@ -214,6 +214,10 @@ def create_acc_ui_msg(packer, CAN: CanBus, CP, main_on: bool, enabled: bool, sta
"AccTGap_D_Dsply": 4, # Fixed time gap in UI
})
# Forwards FCW alert from IPMA
if fcw_alert:
values["FcwVisblWarn_B_Rq"] = 1 # FCW visible alert
return packer.make_can_msg("ACCDATA_3", CAN.main, values)