fix old length for sim module

This commit is contained in:
iceman1001 2023-10-18 15:18:58 +02:00
parent fea78ae95a
commit 14a0e0bc72

View file

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