Skip to content

Commit

Permalink
fix that
Browse files Browse the repository at this point in the history
  • Loading branch information
adeebshihadeh committed Nov 23, 2022
1 parent 21c3a22 commit 16f2250
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion board/can_definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ typedef struct {
unsigned char data[CANPACKET_DATA_SIZE_MAX];
} __attribute__((packed, aligned(4))) CANPacket_t;

#define CANPACKET_HEAD_SIZE (sizeof(CANPacket_t) - (CANPACKET_DATA_SIZE_MAX / 8))
#define CANPACKET_HEAD_SIZE 5U

#define GET_BUS(msg) ((msg)->bus)
#define GET_LEN(msg) (dlc_to_len[(msg)->data_len_code])
Expand Down
7 changes: 4 additions & 3 deletions board/main_comms.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ asm_buffer can_write_overflow = {.ptr = 0U, .tail_size = 0U};

bool add_magic = true;

// read out as many CAN messages as we can fit in a max_len chunk,
// including partial messages, which will be continued in the
// beginning of the next chunk.
// for CAN read and send, we write out a buffer consisting of:
// CAN_TRANSACTION_MAGIC + (N * CANPacket_t)
// comms_can_read will output this buffer into chunks of size max_len.
this buffer is split into chunks output by the comms_can_xxx functions.
int comms_can_read(uint8_t *data, uint32_t max_len) {
uint32_t pos = 0U; // count of bytes written
bool added_magic = false;
Expand Down

0 comments on commit 16f2250

Please sign in to comment.