From 91de0e8da5ad3ccdc3090eaa2e5fe43b178e249f Mon Sep 17 00:00:00 2001 From: dragonpilot Date: Tue, 17 Mar 2020 09:39:02 +1000 Subject: [PATCH] disable pre_enable state under certain conditions --- selfdrive/car/interfaces.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/interfaces.py b/selfdrive/car/interfaces.py index 936274fce..cb3883673 100644 --- a/selfdrive/car/interfaces.py +++ b/selfdrive/car/interfaces.py @@ -128,8 +128,10 @@ class CarInterfaceBase(): events.append(create_event('wrongCarMode', [ET.NO_ENTRY, ET.USER_DISABLE])) if cs_out.espDisabled: events.append(create_event('espDisabled', [ET.NO_ENTRY, ET.SOFT_DISABLE])) - if cs_out.gasPressed: - events.append(create_event('pedalPressed', [ET.PRE_ENABLE])) + if not self.dragon_toyota_stock_dsu: + if not self.dragon_allow_gas: + if cs_out.gasPressed: + events.append(create_event('pedalPressed', [ET.PRE_ENABLE])) # TODO: move this stuff to the capnp strut if not self.dragon_lat_ctrl: