From 6886be926d54b2395e6ddb5bb33593ef12af1446 Mon Sep 17 00:00:00 2001 From: George Hotz Date: Thu, 24 Aug 2017 17:52:54 -0700 Subject: [PATCH] add ABOM, fix bug in tests --- board/drivers/can.h | 7 ++----- tests/automated/helpers.py | 3 ++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/board/drivers/can.h b/board/drivers/can.h index f75ba8537..2215b1203 100644 --- a/board/drivers/can.h +++ b/board/drivers/can.h @@ -137,7 +137,7 @@ void can_init(uint8_t can_number) { } // reset - CAN->MCR = CAN_MCR_TTCM; + CAN->MCR = CAN_MCR_TTCM | CAN_MCR_ABOM; #define CAN_TIMEOUT 1000000 int tmp = 0; @@ -161,10 +161,7 @@ void can_init(uint8_t can_number) { CAN->FMR &= ~(CAN_FMR_FINIT); - // enable all CAN interrupts - //CAN->IER = 0xFFFFFFFF; - //CAN->IER = CAN_IER_TMEIE | CAN_IER_FMPIE0 | CAN_IER_FMPIE1; - //CAN->IER = CAN_IER_TMEIE; + // enable certain CAN interrupts CAN->IER = CAN_IER_TMEIE | CAN_IER_FMPIE0; switch (can_number) { diff --git a/tests/automated/helpers.py b/tests/automated/helpers.py index 7a75b7a35..f24e066b9 100644 --- a/tests/automated/helpers.py +++ b/tests/automated/helpers.py @@ -10,12 +10,13 @@ def connect_wo_esp(): # power down the ESP p.set_esp_power(False) - return p # clear old junk while len(p.can_recv()) > 0: pass + return p + def connect_wifi(): p = Panda() ssid, pw = p.get_serial()