First Commit as a new library
Dependents: Host_Software_MAX32664GWEB_HR_wrist Host_Software_MAX32664GWEC_SpO2_HR Host_Software_MAX32664GWEB_HR_EXTENDED Host_Software_MAX32664GWEC_SpO2_HR-_EXTE ... more
Diff: bmi160_i2c.cpp
- Revision:
- 19:8e66f58bef44
- Parent:
- 9:ca6b5fecdd63
- Child:
- 21:f7216b5dc6c0
--- a/bmi160_i2c.cpp Tue Jul 11 19:38:42 2017 +0000 +++ b/bmi160_i2c.cpp Fri May 04 13:32:36 2018 +0300 @@ -88,11 +88,11 @@ const uint8_t *data) { int32_t numBytes = ((stopReg - startReg) + 1); - char packet[numBytes + 1]; + char packet[32]; packet[0] = static_cast<char>(startReg); memcpy(packet + 1, data, numBytes); - return m_i2cBus.write(m_Wadrs, packet, sizeof(packet)); + return m_i2cBus.write(m_Wadrs, packet, (numBytes+1) * sizeof(char)); }