[riot-notifications] [RIOT-OS/RIOT] drivers: add support for SHT2x (I2C temp and humidity sensor) (#10750)

Peter Kietzmann notifications at github.com
Mon Feb 4 11:53:38 CET 2019


PeterKietzmann commented on this pull request.



> +    cmd_t command = eReadUserCmd;
+
+    if (userreg) {
+        int i2c_result;
+        DEBUG("[SHT2x] read command: addr=%02x cmd=%02x\n", ADDR, (uint8_t)command);
+        i2c_acquire(BUS);
+        i2c_result = i2c_read_reg(BUS, ADDR, (uint8_t)command, userreg, 0);
+        i2c_release(BUS);
+        if (i2c_result != 0) {
+            return SHT2X_ERR_I2C_READ;
+        }
+    } else {
+        return SHT2X_ERR_OTHER;
+    }
+
+    return SHT2X_OK;

Return values not fully aligned with documentation

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10750#pullrequestreview-199527779
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190204/b24e11bb/attachment-0001.html>


More information about the notifications mailing list