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_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 {
|
enum {
|
||||||
CHRYSLER_RAM_DT,
|
CHRYSLER_RAM_DT,
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
static bool elm327_tx_hook(CANPacket_t *to_send) {
|
static bool elm327_tx_hook(CANPacket_t *to_send) {
|
||||||
|
|
||||||
int tx = 1;
|
int tx = 1;
|
||||||
int addr = GET_ADDR(to_send);
|
int addr = GET_ADDR(to_send);
|
||||||
int len = GET_LEN(to_send);
|
int len = GET_LEN(to_send);
|
||||||
|
|
|
@ -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) {
|
static bool gm_tx_hook(CANPacket_t *to_send) {
|
||||||
int tx = 1;
|
int tx = 1;
|
||||||
int addr = GET_ADDR(to_send);
|
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;
|
return tx;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int gm_fwd_hook(int bus_num, int addr) {
|
static int gm_fwd_hook(int bus_num, int addr) {
|
||||||
|
|
||||||
int bus_fwd = -1;
|
int bus_fwd = -1;
|
||||||
|
|
||||||
if (gm_hw == GM_CAM) {
|
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_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_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
|
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) {
|
static bool honda_tx_hook(CANPacket_t *to_send) {
|
||||||
int tx = 1;
|
int tx = 1;
|
||||||
int addr = GET_ADDR(to_send);
|
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;
|
return tx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ RxCheck toyota_rx_checks[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
// safety param flags
|
// 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_PARAM_OFFSET = 8U;
|
||||||
const uint32_t TOYOTA_EPS_FACTOR = (1U << TOYOTA_PARAM_OFFSET) - 1U;
|
const uint32_t TOYOTA_EPS_FACTOR = (1U << TOYOTA_PARAM_OFFSET) - 1U;
|
||||||
const uint32_t TOYOTA_PARAM_ALT_BRAKE = 1U << TOYOTA_PARAM_OFFSET;
|
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];
|
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) {
|
} 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];
|
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];
|
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;
|
return tx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -213,7 +213,6 @@ static bool volkswagen_pq_tx_hook(CANPacket_t *to_send) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1 allows the message through
|
|
||||||
return tx;
|
return tx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue