Skip to content

Commit

Permalink
try const
Browse files Browse the repository at this point in the history
  • Loading branch information
ebg1223 committed May 26, 2023
1 parent 3b60cc3 commit d098f63
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions board/safety/safety_hyundai_canfd.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ bool hyundai_canfd_alt_buttons = false;


static addr_checks build_canfd_addr_checks(void) {
AddrCheckStruct new_addresses[BASE_ADDR_CHECK_LEN + 1];
const AddrCheckStruct new_addresses[BASE_ADDR_CHECK_LEN + 1] = {0};

if(hyundai_longitudinal) {
return (addr_checks){base_addr_checks, BASE_ADDR_CHECK_LEN};
Expand All @@ -97,7 +97,7 @@ static addr_checks build_canfd_addr_checks(void) {
if (hyundai_camera_scc) {
new_addresses[BASE_ADDR_CHECK_LEN] = (AddrCheckStruct){.msg = {{0x1a0, 0, 32, .check_checksum = true, .max_counter = 0xffU, .expected_timestep = 20000U}, { 0 }, { 0 }}};
} else {
new_addresses[sizeof(base_addr_checks) / sizeof(AddrCheckStruct)] = (AddrCheckStruct){.msg = {{0x1a0, 1, 32, .check_checksum = true, .max_counter = 0xffU, .expected_timestep = 20000U},
new_addresses[BASE_ADDR_CHECK_LEN] = (AddrCheckStruct){.msg = {{0x1a0, 1, 32, .check_checksum = true, .max_counter = 0xffU, .expected_timestep = 20000U},
{0x1a0, 2, 32, .check_checksum = true, .max_counter = 0xffU, .expected_timestep = 20000U}, { 0 }}};
}
return (addr_checks){new_addresses, BASE_ADDR_CHECK_LEN + 1};
Expand Down

0 comments on commit d098f63

Please sign in to comment.