[riot-notifications] [RIOT-OS/RIOT] drivers/adcxx1c: improve error handling (#10526)

Vincent Dupont notifications at github.com
Fri Jan 11 17:19:13 CET 2019


vincent-d commented on this pull request.



>  
     hysteresis <<= (12 - dev->params.bits);
     buf[0] = hysteresis >> 8;
     buf[1] = hysteresis & 0xFF;
-    i2c_write_regs(I2C, ADDR, ADCXX1C_HYSTERESIS_ADDR, buf, 2, 0);
+    status = i2c_write_regs(I2C, ADDR, ADCXX1C_HYSTERESIS_ADDR, buf, 2, 0);
+    if (status < 0) {
+        i2c_release(I2C);
+        LOG_DEBUG("[adcxx1c] set_alert (hysteresis) - error: unable to communicate "

Fixed

-- 
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/10526#discussion_r247172389
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190111/edff8f42/attachment.html>


More information about the notifications mailing list