diff --git a/selfdrive/car/__init__.py b/selfdrive/car/__init__.py index 51c99e3040..47e18d9e67 100644 --- a/selfdrive/car/__init__.py +++ b/selfdrive/car/__init__.py @@ -22,11 +22,11 @@ def apply_hysteresis(val: float, val_steady: float, hyst_gap: float) -> float: def create_button_events(cur_btn: int, prev_btn: int, buttons_dict: Dict[int, capnp.lib.capnp._EnumModule], - unpressed_btn: int = 0, init: Optional[int] = None) -> List[capnp.lib.capnp._DynamicStructBuilder]: + unpressed_btn: int = 0, init_btn: Optional[int] = None) -> List[capnp.lib.capnp._DynamicStructBuilder]: events = [] # Initialized to unpressed, don't add any events - if cur_btn == unpressed_btn and prev_btn == init: + if cur_btn == unpressed_btn and prev_btn == init_btn: return events # Add events for button presses, handling when a button switches without going to unpressed