Skip to content

Commit

Permalink
refactor pedal bootstub to use llcan
Browse files Browse the repository at this point in the history
  • Loading branch information
geohot committed May 23, 2019
1 parent 58ec63b commit 1f97c21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
6 changes: 0 additions & 6 deletions board/bootstub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
7 changes: 4 additions & 3 deletions board/spi_flasher.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -241,7 +242,7 @@ void CAN1_RX0_IRQHandler() {
}

void CAN1_SCE_IRQHandler() {
can_sce(CAN);
llcan_clear_send(CAN);
}

#endif
Expand All @@ -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
Expand Down

0 comments on commit 1f97c21

Please sign in to comment.