From 1f97c2189b2e0c0e59c8a6737ad763aa2c65243d Mon Sep 17 00:00:00 2001 From: George Hotz Date: Tue, 21 May 2019 17:14:46 -0700 Subject: [PATCH] refactor pedal bootstub to use llcan --- board/bootstub.c | 6 ------ board/spi_flasher.h | 7 ++++--- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/board/bootstub.c b/board/bootstub.c index 366152e9..6fcb386d 100644 --- a/board/bootstub.c +++ b/board/bootstub.c @@ -27,12 +27,6 @@ void puth(unsigned int i) {} #include "drivers/usb.h" //#include "drivers/uart.h" -#ifdef PEDAL -#define CUSTOM_CAN_INTERRUPTS -#include "safety.h" -#include "drivers/can.h" -#endif - #include "crypto/rsa.h" #include "crypto/sha.h" diff --git a/board/spi_flasher.h b/board/spi_flasher.h index b0cb830d..97432204 100644 --- a/board/spi_flasher.h +++ b/board/spi_flasher.h @@ -134,6 +134,7 @@ int spi_cb_rx(uint8_t *data, int len, uint8_t *data_out) { #ifdef PEDAL +#include "drivers/llcan.h" #define CAN CAN1 #define CAN_BL_INPUT 0x1 @@ -241,7 +242,7 @@ void CAN1_RX0_IRQHandler() { } void CAN1_SCE_IRQHandler() { - can_sce(CAN); + llcan_clear_send(CAN); } #endif @@ -266,8 +267,8 @@ void soft_flasher_start() { set_can_enable(CAN1, 1); // init can - can_silent = ALL_CAN_LIVE; - can_init(0); + llcan_set_speed(CAN1, 5000, false, false); + llcan_init(CAN1); #endif // A4,A5,A6,A7: setup SPI