diff --git a/board/can.h b/board/can.h index 6b1294197..9b1200384 100644 --- a/board/can.h +++ b/board/can.h @@ -1,7 +1,7 @@ #pragma once #include "can_declarations.h" -const uint8_t PANDA_CAN_CNT = 3U; -const uint8_t PANDA_BUS_CNT = 3U; +static const uint8_t PANDA_CAN_CNT = 3U; +static const uint8_t PANDA_BUS_CNT = 3U; -const unsigned char dlc_to_len[DLC_TO_LEN_ARRAY_SIZE] = {0U, 1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 12U, 16U, 20U, 24U, 32U, 48U, 64U}; +static const unsigned char dlc_to_len[] = {0U, 1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 12U, 16U, 20U, 24U, 32U, 48U, 64U}; diff --git a/board/can_declarations.h b/board/can_declarations.h index 8de9bd517..569e2939a 100644 --- a/board/can_declarations.h +++ b/board/can_declarations.h @@ -1,8 +1,5 @@ #pragma once -extern const uint8_t PANDA_CAN_CNT; -extern const uint8_t PANDA_BUS_CNT; - // bump this when changing the CAN packet #define CAN_PACKET_VERSION 4 @@ -27,9 +24,6 @@ typedef struct { unsigned char data[CANPACKET_DATA_SIZE_MAX]; } __attribute__((packed, aligned(4))) CANPacket_t; -#define DLC_TO_LEN_ARRAY_SIZE 16 -extern const unsigned char dlc_to_len[DLC_TO_LEN_ARRAY_SIZE]; - #define GET_BUS(msg) ((msg)->bus) #define GET_LEN(msg) (dlc_to_len[(msg)->data_len_code]) #define GET_ADDR(msg) ((msg)->addr)