From 2037a2ead7257deadf6165734fd19b9b87de6eb7 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Tue, 24 Sep 2024 11:59:17 -0700 Subject: [PATCH] Fix openpilot build (#2039) * static * test * revert --- board/can.h | 6 +++--- board/can_declarations.h | 6 ------ 2 files changed, 3 insertions(+), 9 deletions(-) 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)