Skip to content

Commit

Permalink
ELM327 safety mode: re use existing functions
Browse files Browse the repository at this point in the history
  • Loading branch information
rbiasini committed May 23, 2019
1 parent cd104e2 commit 1114cb1
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions board/safety/safety_elm327.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
static void elm327_rx_hook(CAN_FIFOMailBox_TypeDef *to_push) {}

static int elm327_tx_hook(CAN_FIFOMailBox_TypeDef *to_send) {
//All ELM traffic must appear on CAN0
if(((to_send->RDTR >> 4) & 0xf) != 0) return 0;
Expand Down Expand Up @@ -27,20 +25,12 @@ static int elm327_tx_lin_hook(int lin_num, uint8_t *data, int len) {
return true;
}

static void elm327_init(int16_t param) {
controls_allowed = 1;
}

static int elm327_fwd_hook(int bus_num, CAN_FIFOMailBox_TypeDef *to_fwd) {
return -1;
}

const safety_hooks elm327_hooks = {
.init = elm327_init,
.rx = elm327_rx_hook,
.init = nooutput_init,
.rx = default_rx_hook,
.tx = elm327_tx_hook,
.tx_lin = elm327_tx_lin_hook,
.ignition = default_ign_hook,
.fwd = elm327_fwd_hook,
.fwd = nooutput_fwd_hook,
.relay = nooutput_relay_hook,
};

0 comments on commit 1114cb1

Please sign in to comment.