[riot-notifications] [RIOT-OS/RIOT] Driver for AT24CXXX EEPROM (#11929)

fabian18 notifications at github.com
Mon Jul 29 23:20:42 CEST 2019


fabian18 commented on this pull request.



> +
+    _position_to_address_words(buffer, pos);
+
+    buffer[sizeof(buffer) - 1] = data;
+
+    int check;
+
+    check = i2c_write_bytes(dev->params.i2c, dev->params.dev_addr, buffer,
+                            sizeof(buffer), 0);
+    DEBUG("write_byte check: %d\n", check);
+    if (check < 0) {
+        //check is a negative errno value
+        return check;
+    }
+
+    xtimer_usleep(AT24CXXX_MAX_WRITE_CYCLE * US_PER_MS);

Some delay after a write operation was necessary.
A better approach would be to attempt to perform the requested operation for at most 5ms, right? But I think I would poll for the return value not being -ETIMEDOUT, instead of being 0.

-- 
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/11929#discussion_r308442972
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190729/eda08b5b/attachment.htm>


More information about the notifications mailing list