![]() ![]() Submit a pull request to add a BUFFER_LENGTH page to the Wire library's section of the Arduino Language reference:.I would suggest the following action items: Is there something I am missing on this topic? Sure I could proceed and hard code to 32 bytes and HOPE the platforms that don't define anything will match the Arduino documentation. But I can't as the API is so fractured across platforms at the moment around this specific detail. While considering writing a routine in an EEPROM library to read bytes, if the user requests more than the BUFFER_LENGTH I want to chunk up the request for them OR provide an error to let them know the request was too large. Some of the libraries for platforms don't even define a constant for this value at all.When I see something labeled SIZE versus LENGTH, SIZE intones "count of bytes" while LENGTH intones "count of elements" where size of element is not important.The name used in many of the libraries for this constant seems a little too generic, and the name used by the ESP32 is more appropriate.WIRE_HAS_BUFFER_SIZE means Wire has setBufferSize() #define BUFFER_LENGTH 32įor ESP32 they use a more specific name and even extend the concept to include the ability to change the size and know if size changing is exposed in the API. The WIRE library for AVR and SAMD platform defines a macro that sets the limit of the buffer. I believe the buffer size limit needs to be ratified and refactored across the Arduino IDE and its platforms to be consistent.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |