Honda: forwarding CAN0 to camera, so camera can stay on (#139)

* Honda: forwarding CAN0 to camera, so camera can stay on

* fwd some honda camera msgs

* add crv and rdx steering msg to honda fwd filter
master
rbiasini 2018-11-03 17:11:51 -07:00 committed by GitHub
parent 4dd3f5ac01
commit 915ee4f585
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 23 additions and 9 deletions

View File

@ -138,15 +138,6 @@ static void honda_init(int16_t param) {
honda_alt_brake_msg = false;
}
const safety_hooks honda_hooks = {
.init = honda_init,
.rx = honda_rx_hook,
.tx = honda_tx_hook,
.tx_lin = nooutput_tx_lin_hook,
.ignition = default_ign_hook,
.fwd = nooutput_fwd_hook,
};
static void honda_bosch_init(int16_t param) {
controls_allowed = 0;
bosch_hardware = true;
@ -154,6 +145,20 @@ static void honda_bosch_init(int16_t param) {
honda_alt_brake_msg = param == 1 ? true : false;
}
static int honda_fwd_hook(int bus_num, CAN_FIFOMailBox_TypeDef *to_fwd) {
// fwd from car to camera. also fwd certain msgs from camera to car
// 0xE4 is steering on all cars except CRV and RDX. 0x194 for CRV and RDX
int addr = to_fwd->RIR>>21;
if (bus_num == 0) {
return 2;
} else if (bus_num == 2 && addr != 0xE4 && addr != 0x1FA && addr != 0x30C &&
addr != 0x33D && addr != 0x35E && addr != 0x39E && addr != 0x194) {
return 0;
}
return -1;
}
static int honda_bosch_fwd_hook(int bus_num, CAN_FIFOMailBox_TypeDef *to_fwd) {
if (bus_num == 1 || bus_num == 2) {
int addr = to_fwd->RIR>>21;
@ -162,6 +167,15 @@ static int honda_bosch_fwd_hook(int bus_num, CAN_FIFOMailBox_TypeDef *to_fwd) {
return -1;
}
const safety_hooks honda_hooks = {
.init = honda_init,
.rx = honda_rx_hook,
.tx = honda_tx_hook,
.tx_lin = nooutput_tx_lin_hook,
.ignition = default_ign_hook,
.fwd = honda_fwd_hook,
};
const safety_hooks honda_bosch_hooks = {
.init = honda_bosch_init,
.rx = honda_rx_hook,