Skip to content

Commit

Permalink
fix old length for sim module
Browse files Browse the repository at this point in the history
  • Loading branch information
iceman1001 committed Oct 18, 2023
1 parent fea78ae commit 14a0e0b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions armsrc/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,15 @@ int16_t I2C_BufferRead(uint8_t *data, uint16_t len, uint8_t device_cmd, uint8_t
case 1: {
// Length (LSB)
recv_len += *data;

// old packages..
if (recv_len > 0x0200) {
// [0] = len
// [1] = data
recv_len >>= 8;
data++;
}

// Adjust len if needed
if (len > recv_len) {
len = recv_len;
Expand Down

0 comments on commit 14a0e0b

Please sign in to comment.