Cherry pick

This commit is contained in:
Isaac
2024-02-20 16:08:39 -05:00
parent bda7a60f86
commit f5374f6e89
2 changed files with 10 additions and 2 deletions
+8 -1
View File
@@ -3,7 +3,8 @@ from panda import Panda
from openpilot.common.conversions import Conversions as CV
from openpilot.selfdrive.car import get_safety_config, create_mads_event
from openpilot.selfdrive.car.ford.fordcan import CanBus
from openpilot.selfdrive.car.ford.values import CANFD_CAR, CAR, Ecu, BUTTON_STATES
from openpilot.common.params import Params
from openpilot.selfdrive.car.ford.values import CANFD_CAR, CAR, Ecu, BUTTON_STATES, FordFlagsSP
from openpilot.selfdrive.car.interfaces import CarInterfaceBase
ButtonType = car.CarState.ButtonEvent.Type
@@ -45,6 +46,12 @@ class CarInterface(CarInterfaceBase):
if candidate in CANFD_CAR:
ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_FORD_CANFD
if ret.spFlags & FordFlagsSP.SP_ENHANCED_LAT_CONTROL:
ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_FORD_ENHANCED_LAT_CONTROL
if Params().get("DongleId", encoding='utf8') in ("4fde83db16dc0802", "112e4d6e0cad05e1", "e36b272d5679115f", "24574459dd7fb3e0", "83a4e056c7072678")
ret.spFlags |= FordFlagsSP.SP_ENHANCED_LAT_CONTROL.value
if candidate == CAR.BRONCO_SPORT_MK1:
ret.wheelbase = 2.67
ret.steerRatio = 17.7
+2 -1
View File
@@ -39,7 +39,6 @@ class CarControllerParams:
def __init__(self, CP):
pass
BUTTON_STATES = {
"accelCruise": False,
"decelCruise": False,
@@ -134,3 +133,5 @@ FW_QUERY_CONFIG = FwQueryConfig(
(Ecu.shiftByWire, 0x732, None),
],
)
class FordFlagsSP(IntFlag):
SP_ENHANCED_LAT_CONTROL = 1