mirror of https://github.com/commaai/panda.git
safety: cleanup comments
This commit is contained in:
parent
83acc65743
commit
194f2d9657
|
@ -121,7 +121,7 @@ RxCheck chrysler_ram_hd_rx_checks[] = {
|
|||
|
||||
|
||||
const uint32_t CHRYSLER_PARAM_RAM_DT = 1U; // set for Ram DT platform
|
||||
const uint32_t CHRYSLER_PARAM_RAM_HD = 2U; // set for Ram DT platform
|
||||
const uint32_t CHRYSLER_PARAM_RAM_HD = 2U; // set for Ram HD platform
|
||||
|
||||
enum {
|
||||
CHRYSLER_RAM_DT,
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
static bool elm327_tx_hook(CANPacket_t *to_send) {
|
||||
|
||||
int tx = 1;
|
||||
int addr = GET_ADDR(to_send);
|
||||
int len = GET_LEN(to_send);
|
||||
|
||||
//All ISO 15765-4 messages must be 8 bytes long
|
||||
// All ISO 15765-4 messages must be 8 bytes long
|
||||
if (len != 8) {
|
||||
tx = 0;
|
||||
}
|
||||
|
||||
//Check valid 29 bit send addresses for ISO 15765-4
|
||||
//Check valid 11 bit send addresses for ISO 15765-4
|
||||
// Check valid 29 bit send addresses for ISO 15765-4
|
||||
// Check valid 11 bit send addresses for ISO 15765-4
|
||||
if ((addr != 0x18DB33F1) && ((addr & 0x1FFF00FF) != 0x18DA00F1) &&
|
||||
((addr & 0x1FFFFF00) != 0x600) && ((addr & 0x1FFFFF00) != 0x700)) {
|
||||
tx = 0;
|
||||
|
@ -21,14 +20,14 @@ static bool elm327_tx_hook(CANPacket_t *to_send) {
|
|||
static bool elm327_tx_lin_hook(int lin_num, uint8_t *data, int len) {
|
||||
int tx = 1;
|
||||
if (lin_num != 0) {
|
||||
tx = 0; //Only operate on LIN 0, aka serial 2
|
||||
tx = 0; // Only operate on LIN 0, aka serial 2
|
||||
}
|
||||
if ((len < 5) || (len > 11)) {
|
||||
tx = 0; //Valid KWP size
|
||||
tx = 0; // Valid KWP size
|
||||
}
|
||||
if (!(((data[0] & 0xF8U) == 0xC0U) && ((data[0] & 0x07U) != 0U) &&
|
||||
(data[1] == 0x33U) && (data[2] == 0xF1U))) {
|
||||
tx = 0; //Bad msg
|
||||
tx = 0; // Bad msg
|
||||
}
|
||||
return tx;
|
||||
}
|
||||
|
|
|
@ -135,12 +135,6 @@ static void gm_rx_hook(CANPacket_t *to_push) {
|
|||
}
|
||||
}
|
||||
|
||||
// all commands: gas/regen, friction brake and steering
|
||||
// if controls_allowed and no pedals pressed
|
||||
// allow all commands up to limit
|
||||
// else
|
||||
// block all commands that produce actuation
|
||||
|
||||
static bool gm_tx_hook(CANPacket_t *to_send) {
|
||||
int tx = 1;
|
||||
int addr = GET_ADDR(to_send);
|
||||
|
@ -191,12 +185,10 @@ static bool gm_tx_hook(CANPacket_t *to_send) {
|
|||
}
|
||||
}
|
||||
|
||||
// 1 allows the message through
|
||||
return tx;
|
||||
}
|
||||
|
||||
static int gm_fwd_hook(int bus_num, int addr) {
|
||||
|
||||
int bus_fwd = -1;
|
||||
|
||||
if (gm_hw == GM_CAM) {
|
||||
|
|
|
@ -1,11 +1,3 @@
|
|||
// board enforces
|
||||
// in-state
|
||||
// accel set/resume
|
||||
// out-state
|
||||
// cancel button
|
||||
// accel rising edge
|
||||
// brake rising edge
|
||||
// brake > 0mph
|
||||
const CanMsg HONDA_N_TX_MSGS[] = {{0xE4, 0, 5}, {0x194, 0, 4}, {0x1FA, 0, 8}, {0x200, 0, 6}, {0x30C, 0, 8}, {0x33D, 0, 5}};
|
||||
const CanMsg HONDA_BOSCH_TX_MSGS[] = {{0xE4, 0, 5}, {0xE5, 0, 8}, {0x296, 1, 4}, {0x33D, 0, 5}, {0x33DA, 0, 5}, {0x33DB, 0, 8}}; // Bosch
|
||||
const CanMsg HONDA_BOSCH_LONG_TX_MSGS[] = {{0xE4, 1, 5}, {0x1DF, 1, 8}, {0x1EF, 1, 8}, {0x1FA, 1, 8}, {0x30C, 1, 8}, {0x33D, 1, 5}, {0x33DA, 1, 5}, {0x33DB, 1, 8}, {0x39F, 1, 8}, {0x18DAB0F1, 1, 8}}; // Bosch w/ gas and brakes
|
||||
|
@ -268,12 +260,6 @@ static void honda_rx_hook(CANPacket_t *to_push) {
|
|||
|
||||
}
|
||||
|
||||
// all commands: gas, brake and steering
|
||||
// if controls_allowed and no pedals pressed
|
||||
// allow all commands up to limit
|
||||
// else
|
||||
// block all commands that produce actuation
|
||||
|
||||
static bool honda_tx_hook(CANPacket_t *to_send) {
|
||||
int tx = 1;
|
||||
int addr = GET_ADDR(to_send);
|
||||
|
@ -374,7 +360,6 @@ static bool honda_tx_hook(CANPacket_t *to_send) {
|
|||
}
|
||||
}
|
||||
|
||||
// 1 allows the message through
|
||||
return tx;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ RxCheck toyota_rx_checks[] = {
|
|||
};
|
||||
|
||||
// safety param flags
|
||||
// first byte is for eps factor, second is for flags
|
||||
// first byte is for EPS factor, second is for flags
|
||||
const uint32_t TOYOTA_PARAM_OFFSET = 8U;
|
||||
const uint32_t TOYOTA_EPS_FACTOR = (1U << TOYOTA_PARAM_OFFSET) - 1U;
|
||||
const uint32_t TOYOTA_PARAM_ALT_BRAKE = 1U << TOYOTA_PARAM_OFFSET;
|
||||
|
|
|
@ -82,7 +82,8 @@ static uint32_t volkswagen_mqb_compute_crc(CANPacket_t *to_push) {
|
|||
crc ^= (uint8_t[]){0xC4,0xE2,0x4F,0xE4,0xF8,0x2F,0x56,0x81,0x9F,0xE5,0x83,0x44,0x05,0x3F,0x97,0xDF}[counter];
|
||||
} else if (addr == MSG_MOTOR_20) {
|
||||
crc ^= (uint8_t[]){0xE9,0x65,0xAE,0x6B,0x7B,0x35,0xE5,0x5F,0x4E,0xC7,0x86,0xA2,0xBB,0xDD,0xEB,0xB4}[counter];
|
||||
} else { // Undefined CAN message, CRC check expected to fail
|
||||
} else {
|
||||
// Undefined CAN message, CRC check expected to fail
|
||||
}
|
||||
crc = volkswagen_crc8_lut_8h2f[crc];
|
||||
|
||||
|
@ -245,7 +246,6 @@ static bool volkswagen_mqb_tx_hook(CANPacket_t *to_send) {
|
|||
}
|
||||
}
|
||||
|
||||
// 1 allows the message through
|
||||
return tx;
|
||||
}
|
||||
|
||||
|
|
|
@ -213,7 +213,6 @@ static bool volkswagen_pq_tx_hook(CANPacket_t *to_send) {
|
|||
}
|
||||
}
|
||||
|
||||
// 1 allows the message through
|
||||
return tx;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue