mirror of
https://github.com/infiniteCable2/panda.git
synced 2026-02-19 01:33:52 +08:00
refactor pedal bootstub to use llcan
This commit is contained in:
@@ -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"
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user