diff --git a/libraries/AP_HAL_Linux/I2CDriver.cpp b/libraries/AP_HAL_Linux/I2CDriver.cpp index 81a1a6250e..bf461844fa 100644 --- a/libraries/AP_HAL_Linux/I2CDriver.cpp +++ b/libraries/AP_HAL_Linux/I2CDriver.cpp @@ -20,9 +20,8 @@ using namespace Linux; /* constructor */ -LinuxI2CDriver::LinuxI2CDriver(AP_HAL::Semaphore* semaphore, const char *device) : +LinuxI2CDriver::LinuxI2CDriver(AP_HAL::Semaphore* semaphore, const char *device) : _semaphore(semaphore), - _fd(-1), _device(device) { } diff --git a/libraries/AP_HAL_Linux/I2CDriver.h b/libraries/AP_HAL_Linux/I2CDriver.h index 6ec2ffd5a2..c874e778a8 100644 --- a/libraries/AP_HAL_Linux/I2CDriver.h +++ b/libraries/AP_HAL_Linux/I2CDriver.h @@ -41,11 +41,12 @@ public: AP_HAL::Semaphore* get_semaphore() { return _semaphore; } private: - AP_HAL::Semaphore* _semaphore; bool set_address(uint8_t addr); - int _fd; + + AP_HAL::Semaphore* _semaphore; + const char *_device = NULL; + int _fd = -1; uint8_t _addr; - const char *_device; }; #endif // __AP_HAL_LINUX_I2CDRIVER_H__