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

Alexandre Abadie notifications at github.com
Tue Jan 8 21:18:54 CET 2019


aabadie 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 "

I would prefer using the DEBUG, just for consistency. I haven't checked in details but I think this is what is used in general in driver implementations.

-- 
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_r246137589
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190108/bb53be90/attachment.html>


More information about the notifications mailing list