aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/bma180
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/bma180')
-rw-r--r--src/drivers/bma180/bma180.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/drivers/bma180/bma180.cpp b/src/drivers/bma180/bma180.cpp
index cfb625670..079b5d21c 100644
--- a/src/drivers/bma180/bma180.cpp
+++ b/src/drivers/bma180/bma180.cpp
@@ -234,7 +234,7 @@ private:
};
/* helper macro for handling report buffer indices */
-#define INCREMENT(_x, _lim) do { _x++; if (_x >= _lim) _x = 0; } while(0)
+#define INCREMENT(_x, _lim) do { __typeof__(_x) _tmp = _x+1; if (_tmp >= _lim) _tmp = 0; _x = _tmp; } while(0)
BMA180::BMA180(int bus, spi_dev_e device) :