refactor pedal bootstub to use llcan

This commit is contained in:
George Hotz
2019-05-21 17:14:46 -07:00
parent 58ec63b31f
commit 1f97c2189b
2 changed files with 4 additions and 9 deletions

View File

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

View File

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