Chrysler: fix missing button signal on TX (#490)

* Chrysler: fix missing button signal on TX

* fix test
master
Adeeb 2020-04-10 13:48:41 -07:00 committed by GitHub
parent abce8f32b1
commit 62e4d3c369
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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;
}
}

View File

@ -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: