Skip to content

Commit

Permalink
Define BUFFER_LENGTH if not already present
Browse files Browse the repository at this point in the history
Default buffer size for I2C transmissions is 32 if not otherwise set.
This is a band-aid fix since there is almost certainly a more efficient
way to handle this, possibly by removing the chunking process entirely
from the I2Cdev layer if Wire implements it now based on its own
internal buffering (not sure).
  • Loading branch information
jrowberg committed Oct 15, 2018
1 parent 2e9042c commit 900b8f9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Arduino/I2Cdev/I2Cdev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ THE SOFTWARE.

#endif

#ifndef BUFFER_LENGTH
// band-aid fix for platforms without Wire-defined BUFFER_LENGTH (removed from some official implementations)
#define BUFFER_LENGTH 32
#endif

/** Default constructor.
*/
I2Cdev::I2Cdev() {
Expand Down

0 comments on commit 900b8f9

Please sign in to comment.