Skip to content

Commit

Permalink
Fix openpilot build (#2039)
Browse files Browse the repository at this point in the history
* static

* test

* revert
  • Loading branch information
maxime-desroches authored Sep 24, 2024
1 parent afafb0b commit 2037a2e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
6 changes: 3 additions & 3 deletions board/can.h
Original file line number Diff line number Diff line change
@@ -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};
6 changes: 0 additions & 6 deletions board/can_declarations.h
Original file line number Diff line number Diff line change
@@ -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

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

0 comments on commit 2037a2e

Please sign in to comment.