mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-09-29 02:43:42 +08:00
fix logic
This commit is contained in:
@@ -372,7 +372,7 @@ class CarInterface(object):
|
||||
elif not ret.cruiseState.enabled:
|
||||
events.append(create_event('pcmDisable', [ET.USER_DISABLE]))
|
||||
|
||||
if self.dragon_toyota_stock_dsu:
|
||||
if not self.dragon_toyota_stock_dsu:
|
||||
# DragonAllowGas
|
||||
if params.get("DragonAllowGas") == "0":
|
||||
# disable on pedals rising edge or when brake is pressed and speed isn't zero
|
||||
|
||||
@@ -507,7 +507,7 @@ def controlsd_thread(gctx=None):
|
||||
if not CS.canValid:
|
||||
events.append(create_event('canError', [ET.NO_ENTRY, ET.IMMEDIATE_DISABLE]))
|
||||
|
||||
if dragon_toyota_stock_dsu:
|
||||
if not dragon_toyota_stock_dsu:
|
||||
# Only allow engagement with brake pressed when stopped behind another stopped car
|
||||
if CS.brakePressed and sm['plan'].vTargetFuture >= STARTING_TARGET_SPEED and not CP.radarOffCan and CS.vEgo < 0.3:
|
||||
events.append(create_event('noTarget', [ET.NO_ENTRY, ET.IMMEDIATE_DISABLE]))
|
||||
|
||||
Reference in New Issue
Block a user