[riot-notifications] [RIOT-OS/RIOT] cpu/esp*: fix of the error code for I2C address ACK errors (#12134)

Gunar Schorcht notifications at github.com
Thu Sep 5 08:48:33 CEST 2019


gschorcht commented on this pull request.



> +        return -ETIMEDOUT; \
+    }
+
+#define _i2c_return_on_error_write(dev) \
+    if (_i2c_bus[dev].results & I2C_ARBITRATION_LOST_INT_ENA) { \
+        LOG_TAG_DEBUG("i2c", "arbitration lost dev=%u\n", dev); \
+        _i2c_reset_hw (dev); \
+        __asm__ volatile ("isync"); \
+        return -EAGAIN; \
+    } \
+    else if (_i2c_bus[dev].results & I2C_ACK_ERR_INT_ENA) { \
+        LOG_TAG_DEBUG("i2c", "ack error dev=%u\n", dev); \
+        uint32_t _tx_fifo_cnt = _i2c_hw[dev].regs->status_reg.tx_fifo_cnt; \
+        _i2c_reset_hw (dev); \
+        __asm__ volatile ("isync"); \
+        if (_tx_fifo_cnt >= len) { \

@benpicco I tried my best.

-- 
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/12134#discussion_r321098243
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190904/de704c13/attachment.htm>


More information about the notifications mailing list