Skip to content

Commit 10fd5b7

Browse files
authored
safety: checksum and counter are explicitly opt-out (#1939)
* this is what we want * rm old * and now counter * need this * toyota * subaru's good * Tesla and Chrysler * Ford * do some find and replace * do the rest * clean up * remove this * rm * not broken but bad * this was wrong!
1 parent 866beab commit 10fd5b7

18 files changed

+127
-126
lines changed

opendbc/safety/safety.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -181,20 +181,20 @@ static bool rx_msg_safety_check(const CANPacket_t *to_push,
181181

182182
if (index != -1) {
183183
// checksum check
184-
if ((safety_hooks->get_checksum != NULL) && (safety_hooks->compute_checksum != NULL) && cfg->rx_checks[index].msg[cfg->rx_checks[index].status.index].check_checksum) {
184+
if ((safety_hooks->get_checksum != NULL) && (safety_hooks->compute_checksum != NULL) && !cfg->rx_checks[index].msg[cfg->rx_checks[index].status.index].ignore_checksum) {
185185
uint32_t checksum = safety_hooks->get_checksum(to_push);
186186
uint32_t checksum_comp = safety_hooks->compute_checksum(to_push);
187187
cfg->rx_checks[index].status.valid_checksum = checksum_comp == checksum;
188188
} else {
189-
cfg->rx_checks[index].status.valid_checksum = true;
189+
cfg->rx_checks[index].status.valid_checksum = cfg->rx_checks[index].msg[cfg->rx_checks[index].status.index].ignore_checksum;
190190
}
191191

192-
// counter check (max_counter == 0 means skip check)
192+
// counter check
193193
if ((safety_hooks->get_counter != NULL) && (cfg->rx_checks[index].msg[cfg->rx_checks[index].status.index].max_counter > 0U)) {
194194
uint8_t counter = safety_hooks->get_counter(to_push);
195195
update_counter(cfg->rx_checks, index, counter);
196196
} else {
197-
cfg->rx_checks[index].status.wrong_counters = 0U;
197+
cfg->rx_checks[index].status.wrong_counters = cfg->rx_checks[index].msg[cfg->rx_checks[index].status.index].ignore_counter ? 0 : MAX_WRONG_COUNTERS;
198198
}
199199

200200
// quality flag check

opendbc/safety/safety/safety_body.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static bool body_tx_hook(const CANPacket_t *to_send) {
3131

3232
static safety_config body_init(uint16_t param) {
3333
static RxCheck body_rx_checks[] = {
34-
{.msg = {{0x201, 0, 8, .check_checksum = false, .max_counter = 0U, .frequency = 100U}, { 0 }, { 0 }}},
34+
{.msg = {{0x201, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 100U}, { 0 }, { 0 }}},
3535
};
3636

3737
static const CanMsg BODY_TX_MSGS[] = {{0x250, 0, 8}, {0x250, 0, 6}, {0x251, 0, 5}, // body

opendbc/safety/safety/safety_chrysler.h

+16-16
Original file line numberDiff line numberDiff line change
@@ -212,20 +212,20 @@ static safety_config chrysler_init(uint16_t param) {
212212
};
213213

214214
static RxCheck chrysler_ram_dt_rx_checks[] = {
215-
{.msg = {{CHRYSLER_RAM_DT_ADDRS.EPS_2, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 100U}, { 0 }, { 0 }}},
216-
{.msg = {{CHRYSLER_RAM_DT_ADDRS.ESP_1, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}},
217-
{.msg = {{CHRYSLER_RAM_DT_ADDRS.ESP_8, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}},
218-
{.msg = {{CHRYSLER_RAM_DT_ADDRS.ECM_5, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}},
219-
{.msg = {{CHRYSLER_RAM_DT_ADDRS.DAS_3, 2, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}},
215+
{.msg = {{CHRYSLER_RAM_DT_ADDRS.EPS_2, 0, 8, .max_counter = 15U, .frequency = 100U}, { 0 }, { 0 }}},
216+
{.msg = {{CHRYSLER_RAM_DT_ADDRS.ESP_1, 0, 8, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}},
217+
{.msg = {{CHRYSLER_RAM_DT_ADDRS.ESP_8, 0, 8, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}},
218+
{.msg = {{CHRYSLER_RAM_DT_ADDRS.ECM_5, 0, 8, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}},
219+
{.msg = {{CHRYSLER_RAM_DT_ADDRS.DAS_3, 2, 8, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}},
220220
};
221221

222222
static RxCheck chrysler_rx_checks[] = {
223-
{.msg = {{CHRYSLER_ADDRS.EPS_2, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 100U}, { 0 }, { 0 }}},
224-
{.msg = {{CHRYSLER_ADDRS.ESP_1, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}},
225-
//{.msg = {{ESP_8, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}}},
226-
{.msg = {{514, 0, 8, .check_checksum = false, .max_counter = 0U, .frequency = 100U}, { 0 }, { 0 }}},
227-
{.msg = {{CHRYSLER_ADDRS.ECM_5, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}},
228-
{.msg = {{CHRYSLER_ADDRS.DAS_3, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}},
223+
{.msg = {{CHRYSLER_ADDRS.EPS_2, 0, 8, .max_counter = 15U, .frequency = 100U}, { 0 }, { 0 }}},
224+
{.msg = {{CHRYSLER_ADDRS.ESP_1, 0, 8, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}},
225+
//{.msg = {{ESP_8, 0, 8, .max_counter = 15U, .frequency = 50U}}},
226+
{.msg = {{514, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 100U}, { 0 }, { 0 }}},
227+
{.msg = {{CHRYSLER_ADDRS.ECM_5, 0, 8, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}},
228+
{.msg = {{CHRYSLER_ADDRS.DAS_3, 0, 8, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}},
229229
};
230230

231231
static const CanMsg CHRYSLER_TX_MSGS[] = {
@@ -254,11 +254,11 @@ static safety_config chrysler_init(uint16_t param) {
254254
};
255255

256256
static RxCheck chrysler_ram_hd_rx_checks[] = {
257-
{.msg = {{CHRYSLER_RAM_HD_ADDRS.EPS_2, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 100U}, { 0 }, { 0 }}},
258-
{.msg = {{CHRYSLER_RAM_HD_ADDRS.ESP_1, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}},
259-
{.msg = {{CHRYSLER_RAM_HD_ADDRS.ESP_8, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}},
260-
{.msg = {{CHRYSLER_RAM_HD_ADDRS.ECM_5, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}},
261-
{.msg = {{CHRYSLER_RAM_HD_ADDRS.DAS_3, 2, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}},
257+
{.msg = {{CHRYSLER_RAM_HD_ADDRS.EPS_2, 0, 8, .max_counter = 15U, .frequency = 100U}, { 0 }, { 0 }}},
258+
{.msg = {{CHRYSLER_RAM_HD_ADDRS.ESP_1, 0, 8, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}},
259+
{.msg = {{CHRYSLER_RAM_HD_ADDRS.ESP_8, 0, 8, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}},
260+
{.msg = {{CHRYSLER_RAM_HD_ADDRS.ECM_5, 0, 8, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}},
261+
{.msg = {{CHRYSLER_RAM_HD_ADDRS.DAS_3, 2, 8, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}},
262262
};
263263

264264
static const CanMsg CHRYSLER_RAM_HD_TX_MSGS[] = {

opendbc/safety/safety/safety_ford.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -357,16 +357,16 @@ static safety_config ford_init(uint16_t param) {
357357
// warning: quality flags are not yet checked in openpilot's CAN parser,
358358
// this may be the cause of blocked messages
359359
static RxCheck ford_rx_checks[] = {
360-
{.msg = {{FORD_BrakeSysFeatures, 0, 8, .check_checksum = true, .max_counter = 15U, .quality_flag=true, .frequency = 50U}, { 0 }, { 0 }}},
360+
{.msg = {{FORD_BrakeSysFeatures, 0, 8, .max_counter = 15U, .quality_flag=true, .frequency = 50U}, { 0 }, { 0 }}},
361361
// FORD_EngVehicleSpThrottle2 has a counter that either randomly skips or by 2, likely ECU bug
362362
// Some hybrid models also experience a bug where this checksum mismatches for one or two frames under heavy acceleration with ACC
363363
// It has been confirmed that the Bronco Sport's camera only disallows ACC for bad quality flags, not counters or checksums, so we match that
364-
{.msg = {{FORD_EngVehicleSpThrottle2, 0, 8, .check_checksum = false, .quality_flag=true, .frequency = 50U}, { 0 }, { 0 }}},
365-
{.msg = {{FORD_Yaw_Data_FD1, 0, 8, .check_checksum = true, .max_counter = 255U, .quality_flag=true, .frequency = 100U}, { 0 }, { 0 }}},
364+
{.msg = {{FORD_EngVehicleSpThrottle2, 0, 8, .ignore_checksum = true, .ignore_counter = true, .quality_flag=true, .frequency = 50U}, { 0 }, { 0 }}},
365+
{.msg = {{FORD_Yaw_Data_FD1, 0, 8, .max_counter = 255U, .quality_flag=true, .frequency = 100U}, { 0 }, { 0 }}},
366366
// These messages have no counter or checksum
367-
{.msg = {{FORD_EngBrakeData, 0, 8, .frequency = 10U}, { 0 }, { 0 }}},
368-
{.msg = {{FORD_EngVehicleSpThrottle, 0, 8, .frequency = 100U}, { 0 }, { 0 }}},
369-
{.msg = {{FORD_DesiredTorqBrk, 0, 8, .frequency = 50U}, { 0 }, { 0 }}},
367+
{.msg = {{FORD_EngBrakeData, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 10U}, { 0 }, { 0 }}},
368+
{.msg = {{FORD_EngVehicleSpThrottle, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 100U}, { 0 }, { 0 }}},
369+
{.msg = {{FORD_DesiredTorqBrk, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 50U}, { 0 }, { 0 }}},
370370
};
371371

372372
#define FORD_COMMON_TX_MSGS \

opendbc/safety/safety/safety_gm.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -213,14 +213,14 @@ static safety_config gm_init(uint16_t param) {
213213

214214
// TODO: do checksum and counter checks. Add correct timestep, 0.1s for now.
215215
static RxCheck gm_rx_checks[] = {
216-
{.msg = {{0x184, 0, 8, .frequency = 10U}, { 0 }, { 0 }}},
217-
{.msg = {{0x34A, 0, 5, .frequency = 10U}, { 0 }, { 0 }}},
218-
{.msg = {{0x1E1, 0, 7, .frequency = 10U}, { 0 }, { 0 }}},
219-
{.msg = {{0xBE, 0, 6, .frequency = 10U}, // Volt, Silverado, Acadia Denali
220-
{0xBE, 0, 7, .frequency = 10U}, // Bolt EUV
221-
{0xBE, 0, 8, .frequency = 10U}}}, // Escalade
222-
{.msg = {{0x1C4, 0, 8, .frequency = 10U}, { 0 }, { 0 }}},
223-
{.msg = {{0xC9, 0, 8, .frequency = 10U}, { 0 }, { 0 }}},
216+
{.msg = {{0x184, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 10U}, { 0 }, { 0 }}},
217+
{.msg = {{0x34A, 0, 5, .ignore_checksum = true, .ignore_counter = true, .frequency = 10U}, { 0 }, { 0 }}},
218+
{.msg = {{0x1E1, 0, 7, .ignore_checksum = true, .ignore_counter = true, .frequency = 10U}, { 0 }, { 0 }}},
219+
{.msg = {{0xBE, 0, 6, .ignore_checksum = true, .ignore_counter = true, .frequency = 10U}, // Volt, Silverado, Acadia Denali
220+
{0xBE, 0, 7, .ignore_checksum = true, .ignore_counter = true, .frequency = 10U}, // Bolt EUV
221+
{0xBE, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 10U}}}, // Escalade
222+
{.msg = {{0x1C4, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 10U}, { 0 }, { 0 }}},
223+
{.msg = {{0xC9, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 10U}, { 0 }, { 0 }}},
224224
};
225225

226226
static const CanMsg GM_CAM_TX_MSGS[] = {{0x180, 0, 4}, // pt bus

opendbc/safety/safety/safety_honda.h

+11-11
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
#include "safety_declarations.h"
44

55
// All common address checks except SCM_BUTTONS which isn't on one Nidec safety configuration
6-
#define HONDA_COMMON_NO_SCM_FEEDBACK_RX_CHECKS(pt_bus) \
7-
{.msg = {{0x1A6, (pt_bus), 8, .check_checksum = true, .max_counter = 3U, .frequency = 25U}, /* SCM_BUTTONS */ \
8-
{0x296, (pt_bus), 4, .check_checksum = true, .max_counter = 3U, .frequency = 25U}, { 0 }}}, \
9-
{.msg = {{0x158, (pt_bus), 8, .check_checksum = true, .max_counter = 3U, .frequency = 100U}, { 0 }, { 0 }}}, /* ENGINE_DATA */ \
10-
{.msg = {{0x17C, (pt_bus), 8, .check_checksum = true, .max_counter = 3U, .frequency = 100U}, { 0 }, { 0 }}}, /* POWERTRAIN_DATA */ \
6+
#define HONDA_COMMON_NO_SCM_FEEDBACK_RX_CHECKS(pt_bus) \
7+
{.msg = {{0x1A6, (pt_bus), 8, .max_counter = 3U, .frequency = 25U}, /* SCM_BUTTONS */ \
8+
{0x296, (pt_bus), 4, .max_counter = 3U, .frequency = 25U}, { 0 }}}, \
9+
{.msg = {{0x158, (pt_bus), 8, .max_counter = 3U, .frequency = 100U}, { 0 }, { 0 }}}, /* ENGINE_DATA */ \
10+
{.msg = {{0x17C, (pt_bus), 8, .max_counter = 3U, .frequency = 100U}, { 0 }, { 0 }}}, /* POWERTRAIN_DATA */ \
1111

12-
#define HONDA_COMMON_RX_CHECKS(pt_bus) \
13-
HONDA_COMMON_NO_SCM_FEEDBACK_RX_CHECKS(pt_bus) \
14-
{.msg = {{0x326, (pt_bus), 8, .check_checksum = true, .max_counter = 3U, .frequency = 10U}, { 0 }, { 0 }}}, /* SCM_FEEDBACK */ \
12+
#define HONDA_COMMON_RX_CHECKS(pt_bus) \
13+
HONDA_COMMON_NO_SCM_FEEDBACK_RX_CHECKS(pt_bus) \
14+
{.msg = {{0x326, (pt_bus), 8, .max_counter = 3U, .frequency = 10U}, { 0 }, { 0 }}}, /* SCM_FEEDBACK */ \
1515

1616
// Alternate brake message is used on some Honda Bosch, and Honda Bosch radarless (where PT bus is 0)
17-
#define HONDA_ALT_BRAKE_ADDR_CHECK(pt_bus) \
18-
{.msg = {{0x1BE, (pt_bus), 3, .check_checksum = true, .max_counter = 3U, .frequency = 50U}, { 0 }, { 0 }}}, /* BRAKE_MODULE */ \
17+
#define HONDA_ALT_BRAKE_ADDR_CHECK(pt_bus) \
18+
{.msg = {{0x1BE, (pt_bus), 3, .max_counter = 3U, .frequency = 50U}, { 0 }, { 0 }}}, /* BRAKE_MODULE */ \
1919

2020

2121
// Nidec and bosch radarless has the powertrain bus on bus 0
@@ -321,7 +321,7 @@ static safety_config honda_nidec_init(uint16_t param) {
321321

322322
if (enable_nidec_alt) {
323323
// For Nidecs with main on signal on an alternate msg (missing 0x326)
324-
static RxCheck honda_nidec_alt_rx_checks[] = {
324+
static RxCheck honda_nidec_alt_rx_checks[] = {
325325
HONDA_COMMON_NO_SCM_FEEDBACK_RX_CHECKS(0)
326326
};
327327

opendbc/safety/safety/safety_hyundai.h

+9-9
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ const LongitudinalLimits HYUNDAI_LONG_LIMITS = {
3939
{0x389, 0, 8}, /* SCC14 Bus 0 */ \
4040
{0x4A2, 0, 2}, /* FRT_RADAR11 Bus 0 */ \
4141

42-
#define HYUNDAI_COMMON_RX_CHECKS(legacy) \
43-
{.msg = {{0x260, 0, 8, .check_checksum = true, .max_counter = 3U, .frequency = 100U}, \
44-
{0x371, 0, 8, .frequency = 100U}, \
45-
{0x91, 0, 8, .frequency = 100U}}}, \
46-
{.msg = {{0x386, 0, 8, .check_checksum = !(legacy), .max_counter = (legacy) ? 0U : 15U, .frequency = 100U}, { 0 }, { 0 }}}, \
47-
{.msg = {{0x394, 0, 8, .check_checksum = !(legacy), .max_counter = (legacy) ? 0U : 7U, .frequency = 100U}, { 0 }, { 0 }}}, \
42+
#define HYUNDAI_COMMON_RX_CHECKS(legacy) \
43+
{.msg = {{0x260, 0, 8, .max_counter = 3U, .frequency = 100U}, \
44+
{0x371, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 100U}, \
45+
{0x91, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 100U}}}, \
46+
{.msg = {{0x386, 0, 8, .ignore_checksum = (legacy), .ignore_counter = (legacy), .max_counter = (legacy) ? 0U : 15U, .frequency = 100U}, { 0 }, { 0 }}}, \
47+
{.msg = {{0x394, 0, 8, .ignore_checksum = (legacy), .ignore_counter = (legacy), .max_counter = (legacy) ? 0U : 7U, .frequency = 100U}, { 0 }, { 0 }}}, \
4848

49-
#define HYUNDAI_SCC12_ADDR_CHECK(scc_bus) \
50-
{.msg = {{0x421, (scc_bus), 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}}, \
49+
#define HYUNDAI_SCC12_ADDR_CHECK(scc_bus) \
50+
{.msg = {{0x421, (scc_bus), 8, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}}, \
5151

5252
static const CanMsg HYUNDAI_TX_MSGS[] = {
5353
HYUNDAI_COMMON_TX_MSGS(0)
@@ -311,7 +311,7 @@ static safety_config hyundai_init(uint16_t param) {
311311
static RxCheck hyundai_long_rx_checks[] = {
312312
HYUNDAI_COMMON_RX_CHECKS(false)
313313
// Use CLU11 (buttons) to manage controls allowed instead of SCC cruise state
314-
{.msg = {{0x4F1, 0, 4, .check_checksum = false, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}},
314+
{.msg = {{0x4F1, 0, 4, .ignore_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}},
315315
};
316316

317317
ret = hyundai_camera_scc ? BUILD_SAFETY_CFG(hyundai_long_rx_checks, HYUNDAI_CAMERA_SCC_LONG_TX_MSGS) : \

opendbc/safety/safety/safety_hyundai_canfd.h

+11-11
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@
2525

2626
// *** Addresses checked in rx hook ***
2727
// EV, ICE, HYBRID: ACCELERATOR (0x35), ACCELERATOR_BRAKE_ALT (0x100), ACCELERATOR_ALT (0x105)
28-
#define HYUNDAI_CANFD_COMMON_RX_CHECKS(pt_bus) \
29-
{.msg = {{0x35, (pt_bus), 32, .check_checksum = true, .max_counter = 0xffU, .frequency = 100U}, \
30-
{0x100, (pt_bus), 32, .check_checksum = true, .max_counter = 0xffU, .frequency = 100U}, \
31-
{0x105, (pt_bus), 32, .check_checksum = true, .max_counter = 0xffU, .frequency = 100U}}}, \
32-
{.msg = {{0x175, (pt_bus), 24, .check_checksum = true, .max_counter = 0xffU, .frequency = 50U}, { 0 }, { 0 }}}, \
33-
{.msg = {{0xa0, (pt_bus), 24, .check_checksum = true, .max_counter = 0xffU, .frequency = 100U}, { 0 }, { 0 }}}, \
34-
{.msg = {{0xea, (pt_bus), 24, .check_checksum = true, .max_counter = 0xffU, .frequency = 100U}, { 0 }, { 0 }}}, \
35-
{.msg = {{0x1cf, (pt_bus), 8, .check_checksum = false, .max_counter = 0xfU, .frequency = 50U}, \
36-
{0x1aa, (pt_bus), 16, .check_checksum = false, .max_counter = 0xffU, .frequency = 50U}, { 0 }}}, \
28+
#define HYUNDAI_CANFD_COMMON_RX_CHECKS(pt_bus) \
29+
{.msg = {{0x35, (pt_bus), 32, .max_counter = 0xffU, .frequency = 100U}, \
30+
{0x100, (pt_bus), 32, .max_counter = 0xffU, .frequency = 100U}, \
31+
{0x105, (pt_bus), 32, .max_counter = 0xffU, .frequency = 100U}}}, \
32+
{.msg = {{0x175, (pt_bus), 24, .max_counter = 0xffU, .frequency = 50U}, { 0 }, { 0 }}}, \
33+
{.msg = {{0xa0, (pt_bus), 24, .max_counter = 0xffU, .frequency = 100U}, { 0 }, { 0 }}}, \
34+
{.msg = {{0xea, (pt_bus), 24, .max_counter = 0xffU, .frequency = 100U}, { 0 }, { 0 }}}, \
35+
{.msg = {{0x1cf, (pt_bus), 8, .ignore_checksum = true, .max_counter = 0xfU, .frequency = 50U}, \
36+
{0x1aa, (pt_bus), 16, .ignore_checksum = true, .max_counter = 0xffU, .frequency = 50U}, { 0 }}}, \
3737

3838
// SCC_CONTROL (from ADAS unit or camera)
39-
#define HYUNDAI_CANFD_SCC_ADDR_CHECK(scc_bus) \
40-
{.msg = {{0x1a0, (scc_bus), 32, .check_checksum = true, .max_counter = 0xffU, .frequency = 50U}, { 0 }, { 0 }}}, \
39+
#define HYUNDAI_CANFD_SCC_ADDR_CHECK(scc_bus) \
40+
{.msg = {{0x1a0, (scc_bus), 32, .max_counter = 0xffU, .frequency = 50U}, { 0 }, { 0 }}}, \
4141

4242
static bool hyundai_canfd_alt_buttons = false;
4343
static bool hyundai_canfd_lka_steering_alt = false;

opendbc/safety/safety/safety_mazda.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ static safety_config mazda_init(uint16_t param) {
112112
static const CanMsg MAZDA_TX_MSGS[] = {{MAZDA_LKAS, 0, 8}, {MAZDA_CRZ_BTNS, 0, 8}, {MAZDA_LKAS_HUD, 0, 8}};
113113

114114
static RxCheck mazda_rx_checks[] = {
115-
{.msg = {{MAZDA_CRZ_CTRL, 0, 8, .frequency = 50U}, { 0 }, { 0 }}},
116-
{.msg = {{MAZDA_CRZ_BTNS, 0, 8, .frequency = 10U}, { 0 }, { 0 }}},
117-
{.msg = {{MAZDA_STEER_TORQUE, 0, 8, .frequency = 83U}, { 0 }, { 0 }}},
118-
{.msg = {{MAZDA_ENGINE_DATA, 0, 8, .frequency = 100U}, { 0 }, { 0 }}},
119-
{.msg = {{MAZDA_PEDALS, 0, 8, .frequency = 50U}, { 0 }, { 0 }}},
115+
{.msg = {{MAZDA_CRZ_CTRL, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 50U}, { 0 }, { 0 }}},
116+
{.msg = {{MAZDA_CRZ_BTNS, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 10U}, { 0 }, { 0 }}},
117+
{.msg = {{MAZDA_STEER_TORQUE, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 83U}, { 0 }, { 0 }}},
118+
{.msg = {{MAZDA_ENGINE_DATA, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 100U}, { 0 }, { 0 }}},
119+
{.msg = {{MAZDA_PEDALS, 0, 8, .ignore_checksum = true, .ignore_counter = true, .frequency = 50U}, { 0 }, { 0 }}},
120120
};
121121

122122
UNUSED(param);

0 commit comments

Comments
 (0)