noEntry while holding cancel

pull/26463/head
Shane Smiskol 3 years ago
parent 720c003d4c
commit 4a0ea24cf5
  1. 10
      selfdrive/car/interfaces.py

@ -66,6 +66,7 @@ class CarInterfaceBase(ABC):
self.low_speed_alert = False
self.silent_steer_warning = True
self.v_ego_cluster_seen = False
self.cancel_depressed = False
self.CS = None
self.can_parsers = []
@ -250,8 +251,13 @@ class CarInterfaceBase(ABC):
# Enable OP long on falling edge of enable buttons (defaults to accelCruise and decelCruise, overridable per-port)
if not self.CP.pcmCruise and (b.type in enable_buttons and not b.pressed):
events.add(EventName.buttonEnable)
# Disable on rising edge of cancel for both stock and OP long
if b.type == ButtonType.cancel and b.pressed:
# Disable while cancel is depressed on rising edge of cancel for both stock and OP long
if b.type == ButtonType.cancel:
self.cancel_depressed = b.pressed
# noEntry while cancel is depressed, matches panda
if self.cancel_depressed:
events.add(EventName.buttonCancel)
# Handle permanent and temporary steering faults

Loading…
Cancel
Save