Skip to content

Commit

Permalink
fix: can read DLC correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
AdonaiDiazEsparza committed May 23, 2024
1 parent 65b505a commit 1f14132
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Canbus_app/libraries/mcp_can_2515.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,10 @@ void read_canframe(FuriHalSpiBusHandle* spi, const uint8_t addr, CANFRAME* frame
else
frame->req = 0;

frame->data_lenght = len;

len &= MCP_DLC_MASK;

frame->data_lenght = len;

for(uint8_t i = 0; i < len; i++) {
read_register(spi, addr + 5 + i, &data);
frame->buffer[i] = data;
Expand Down

0 comments on commit 1f14132

Please sign in to comment.