You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Wire library function requestFrom() function returns the number of bytes transferred.
The TinyWireM library code function requestFrom() returns a status where zero means success.
The TinyWireM requestFrom() is fundamentally incompatible with the Wire library requestFrom().
Code that expects the Wire API behavior and checks and uses the return value, breaks.
Given that the Adafruit tiny core provides a Wire wrapper for TinyWireM, the API functions need to behave the same as Wire.
The fix is pretty simple and isolated to the requestFrom() code in TinyWireM.cpp
I'm not sure if there is any concern about breaking any existing code that is depending on the current behavior.
Unfortunately, there is no magic bullet fix, either code that works with Wire breaks or code the depends on existing TinyWireM behavior of requestFrom() breaks when the code is fixed.
The Wire library function requestFrom() function returns the number of bytes transferred.
The TinyWireM library code function requestFrom() returns a status where zero means success.
The TinyWireM requestFrom() is fundamentally incompatible with the Wire library requestFrom().
Code that expects the Wire API behavior and checks and uses the return value, breaks.
Given that the Adafruit tiny core provides a Wire wrapper for TinyWireM, the API functions need to behave the same as Wire.
The fix is pretty simple and isolated to the requestFrom() code in TinyWireM.cpp
I'm not sure if there is any concern about breaking any existing code that is depending on the current behavior.
Unfortunately, there is no magic bullet fix, either code that works with Wire breaks or code the depends on existing TinyWireM behavior of requestFrom() breaks when the code is fixed.
Note that this same issue/bug also affects the TinyWireM library:
https://github.com/adafruit/TinyWireM
The text was updated successfully, but these errors were encountered: