From b09fcfc20ef948b940148443b8470562aefe382a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 5 May 2015 21:42:14 +1000 Subject: [PATCH] HAL_Linux: cope with systems without I2C_RDRW_IOCTL_MAX_MSGS such as my ubuntu 14.04 laptop :-) --- libraries/AP_HAL_Linux/I2CDriver.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/AP_HAL_Linux/I2CDriver.cpp b/libraries/AP_HAL_Linux/I2CDriver.cpp index 5ac132c8e6..81a1a6250e 100644 --- a/libraries/AP_HAL_Linux/I2CDriver.cpp +++ b/libraries/AP_HAL_Linux/I2CDriver.cpp @@ -174,7 +174,11 @@ uint8_t LinuxI2CDriver::readRegistersMultiple(uint8_t addr, uint8_t reg, uint8_t len, uint8_t count, uint8_t* data) { +#ifdef I2C_RDRW_IOCTL_MAX_MSGS const uint8_t max_count = I2C_RDRW_IOCTL_MAX_MSGS / 2; +#else + const uint8_t max_count = 8; +#endif if (_fd == -1) { return 1;