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

Kees Bakker notifications at github.com
Mon Feb 4 19:40:08 CET 2019


keestux commented on this pull request.



> +    }
+
+    i2c_acquire(BUS);
+    res = i2c_read_regs(BUS, ADDR,
+                        second_mem_addr, data2, sizeof(data2), I2C_REG16);
+    i2c_release(BUS);
+    if (res < 0) {
+        return -1;
+    }
+    DEBUG("[SHT2x] ident (2): %02x %02x %02x\n", data2[0], data2[1], data2[2]);
+    DEBUG("[SHT2x] ident (2): %02x %02x %02x\n", data2[3], data2[4], data2[5]);
+    for (size_t ix = 0; ix < sizeof(data2); ix += 3) {
+        if (sht2x_checkcrc(&data2[ix], 2, data2[ix + 2]) != 0) {
+            DEBUG("[SHT2x] checksum error, second (ix=%d)\n", ix);
+        }
+    }

Hmm, I want to add a return SHT2X_ERR_CRC. In that case the loop is still needed.

-- 
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#discussion_r253591824
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190204/518362a5/attachment.html>


More information about the notifications mailing list