From f6375848ca393a9483921665b6a2d131d7ec9b20 Mon Sep 17 00:00:00 2001 From: Hoang Bui <47828508+bongbui321@users.noreply.github.com> Date: Wed, 17 Jul 2024 23:49:10 -0400 Subject: [PATCH] add `set_gas_pressed_prev()` helper (#1986) add set_gas_pressed_prev helper --- tests/libpanda/safety_helpers.h | 4 ++++ tests/libpanda/safety_helpers.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/tests/libpanda/safety_helpers.h b/tests/libpanda/safety_helpers.h index 36887c896..ab4db4757 100644 --- a/tests/libpanda/safety_helpers.h +++ b/tests/libpanda/safety_helpers.h @@ -47,6 +47,10 @@ bool get_gas_pressed_prev(void){ return gas_pressed_prev; } +void set_gas_pressed_prev(bool c){ + gas_pressed_prev = c; +} + bool get_brake_pressed_prev(void){ return brake_pressed_prev; } diff --git a/tests/libpanda/safety_helpers.py b/tests/libpanda/safety_helpers.py index ea41264ae..6b510da6a 100644 --- a/tests/libpanda/safety_helpers.py +++ b/tests/libpanda/safety_helpers.py @@ -11,6 +11,7 @@ def setup_safety_helpers(ffi): void set_relay_malfunction(bool c); bool get_relay_malfunction(void); bool get_gas_pressed_prev(void); + void set_gas_pressed_prev(bool); bool get_brake_pressed_prev(void); bool get_regen_braking_prev(void); bool get_acc_main_on(void); @@ -61,6 +62,7 @@ class PandaSafety(Protocol): def set_relay_malfunction(self, c: bool) -> None: ... def get_relay_malfunction(self) -> bool: ... def get_gas_pressed_prev(self) -> bool: ... + def set_gas_pressed_prev(self, c: bool) -> None: ... def get_brake_pressed_prev(self) -> bool: ... def get_regen_braking_prev(self) -> bool: ... def get_acc_main_on(self) -> bool: ...