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

benpicco notifications at github.com
Tue Jul 30 00:39:54 CEST 2019


benpicco 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);

I'd say a 1ms delay between each polling wold be a possible compromise. What I like about it is that we could do away with a device specific constant and have it 'just work' with any EEPROM than expects a different delay, be it longer or shorter.


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


More information about the notifications mailing list