Skip to content

Commit addac0f

Browse files
committed
fix: correct 16-bit I2C write length
1 parent bc7d1e2 commit addac0f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • code/Unit-RollerCAN/Core/Src

code/Unit-RollerCAN/Core/Src/i2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ uint8_t I2C_Write_16bits_reg_Bytes(uint8_t DeviceAddress, uint16_t MemAddress, u
323323
tx_buffer[1] = ((MemAddress >> 8) & 0xff);
324324
memcpy(&tx_buffer[2], pData, TxLen);
325325

326-
return I2C1_TransmitData(DeviceAddress, tx_buffer, TxLen + 1, Timeout);
326+
return I2C1_TransmitData(DeviceAddress, tx_buffer, TxLen + 2, Timeout);
327327
}
328328

329329
uint8_t I2C_Read_Bytes(uint8_t DeviceAddress, uint8_t MemAddress, uint8_t *pData, uint8_t RxLen, uint16_t Timeout)

0 commit comments

Comments
 (0)