From 62e4d3c36902b9c0ddc33262a17d7c0717843be2 Mon Sep 17 00:00:00 2001 From: Adeeb <8762862+quillford@users.noreply.github.com> Date: Fri, 10 Apr 2020 13:48:41 -0700 Subject: [PATCH] Chrysler: fix missing button signal on TX (#490) * Chrysler: fix missing button signal on TX * fix test --- board/safety/safety_chrysler.h | 2 +- tests/safety/test_chrysler.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/board/safety/safety_chrysler.h b/board/safety/safety_chrysler.h index 016adce..1e18e63 100644 --- a/board/safety/safety_chrysler.h +++ b/board/safety/safety_chrysler.h @@ -194,7 +194,7 @@ static int chrysler_tx_hook(CAN_FIFOMailBox_TypeDef *to_send) { // FORCE CANCEL: only the cancel button press is allowed if (addr == 571) { - if (GET_BYTE(to_send, 0) != 1) { + if ((GET_BYTE(to_send, 0) != 1) || ((GET_BYTE(to_send, 1) & 1) == 1)) { tx = 0; } } diff --git a/tests/safety/test_chrysler.py b/tests/safety/test_chrysler.py index 71ca8b0..a0c51fb 100755 --- a/tests/safety/test_chrysler.py +++ b/tests/safety/test_chrysler.py @@ -239,7 +239,7 @@ class TestChryslerSafety(unittest.TestCase): def test_cancel_button(self): CANCEL = 1 - for b in range(0, 0xff): + for b in range(0, 0x1ff): if b == CANCEL: self.assertTrue(self.safety.safety_tx_hook(self._button_msg(b))) else: