[riot-notifications] [RIOT-OS/RIOT] drivers/ds75lx: add basic driver for temperature sensor (#11505)

Alexandre Abadie notifications at github.com
Tue May 14 08:41:34 CEST 2019


aabadie commented on this pull request.



> +        /* Release I2C device */
+        i2c_release(DEV_I2C);
+
+        return -DS75LX_ERR_I2C;
+    }
+
+    /* Release I2C device */
+    i2c_release(DEV_I2C);
+
+    return DS75LX_OK;
+}
+
+int ds75lx_read_temperature(const ds75lx_t *dev, int16_t *temperature)
+{
+    /* Wait max conversion time (depends on resolution) */
+    xtimer_usleep(_max_conversion_times[dev->params.resolution] * US_PER_MS);

+1 for moving it in the wakeup function. This will ensure that any value read after is up-to-date.

-- 
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/11505#discussion_r283644967
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190513/ef6c2999/attachment-0001.html>


More information about the notifications mailing list