Fix openpilot build (#2039)

* static

* test

* revert
This commit is contained in:
Maxime Desroches 2024-09-24 11:59:17 -07:00 committed by GitHub
parent afafb0ba46
commit 2037a2ead7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 9 deletions

View File

@ -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};

View File

@ -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)