From eeb189592225f36be2614b84259c9e4284d93c52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Wed, 7 Jun 2017 10:23:06 +0200 Subject: [PATCH] i2c_posix: fix simulate variable cannot be assigned on QuRT --- src/drivers/device/i2c_posix.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/drivers/device/i2c_posix.cpp b/src/drivers/device/i2c_posix.cpp index 5a9fb923e9..7a889a51d2 100644 --- a/src/drivers/device/i2c_posix.cpp +++ b/src/drivers/device/i2c_posix.cpp @@ -49,9 +49,15 @@ #include #include +#ifdef __PX4_QURT +#define PX4_SIMULATE_I2C 1 +#else #define PX4_SIMULATE_I2C 0 +#endif + static constexpr const int simulate = PX4_SIMULATE_I2C; + namespace device { @@ -104,10 +110,6 @@ I2C::init() return ret; } -#ifdef __PX4_QURT - simulate = true; -#endif - if (simulate) { _fd = 10000;