[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:47:02 CET 2019


PeterKietzmann commented on this pull request.



> +uint16_t sht2x_read_humidity(const sht2x_t *dev)
+{
+    uint16_t raw_value;
+    int i2c_result;
+    if (dev->params.measure_mode == SHT2X_MEASURE_MODE_NO_HOLD) {
+        i2c_result = read_sensor_poll(dev, eRHumidityNoHoldCmd, &raw_value);
+    } else {
+        i2c_result = read_sensor(dev, eRHumidityHoldCmd, &raw_value);
+    }
+    if (i2c_result != SHT2X_OK) {
+        return 0;
+    }
+    return 100 * (-6.0 + 125.0 / 65536.0 * raw_value);
+}
+
+static int _sht2x_add_ident_byte(uint8_t * buffer, size_t buflen, uint8_t b, size_t ix)

Maybe `static  inline`?

-- 
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-199524958
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190204/7013272c/attachment-0001.html>


More information about the notifications mailing list