summaryrefslogtreecommitdiff
path: root/src/driver
diff options
context:
space:
mode:
Diffstat (limited to 'src/driver')
-rw-r--r--src/driver/max44009.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/driver/max44009.cc b/src/driver/max44009.cc
index d09188c..e124787 100644
--- a/src/driver/max44009.cc
+++ b/src/driver/max44009.cc
@@ -19,7 +19,9 @@ float MAX44009::getLux()
txbuf[0] = 0x03;
txbuf[1] = 0x04;
- i2c.xmit(address, 2, txbuf, 2, rxbuf);
+ if (i2c.xmit(address, 2, txbuf, 2, rxbuf) != 0) {
+ return -1;
+ }
luxHigh = rxbuf[0];
luxLow = rxbuf[1];