Closed hb020 closed 2 years ago
OMG. Was that a year ago?!? I apologize for not responding. I meant to get back to this and then forgot about it.
I see what you mean. My intention was to re-type addr
from uint8_t
to int
before sending it to the Wire library because the int
type is what the Wire library is expecting.
If I understand you correctly, the code compiles successfully as is, but you are getting notifications from your "PlatformIO" IDE that this may not be a C++ best practice. As a solution, you suggest leaving addr
as a type uint8_t
and letting the Wire library do the retyping.
I do not know how to answer your question. I have not gotten any errors myself, and I regret having to say that I do not know what a "pull request" is; but if it makes your process easier or better, then I think that you should do it.
Please let me know what you decide; and thank you for taking an interest in the library.
Bud Ryerson San Francisco
Did some more digging, adapted my proposal to match more versions of the Wire library. See the Pull request.
Now I see that the problem is not retyping the I2C address. The problem is using a boolean value true
for the I2C stop bit. But instead of retyping the boolean value int(true)
as you proposed, I think the problem can be resolved simply by replacing the boolean value with a literal value 1
.
Wire.requestFrom( (int)addr, TFMP_FRAME_SIZE, 1);
What do you think?
should be OK as well.
Hi. I deeply appreciate your gentle corrections and I welcome your collaboration. For now, I'm going to close this conversation while I try to integrate your suggestions. In the meantime, can you please tell me more about yourself? I would like to be able to give you credit for your contributions. Thanks, Bud
In the meantime, can you please tell me more about yourself?
PM sent via Mail a couple of days ago.
Kind regards
This happens on both the latest version from Arduino IDE libraries (1.5, 03 SEP 2020), and the latest git version (also 1.5, but 27 SEP 2020)
There are 2 errors like this:
Best is to address a specific signature of TwoWire::requestFrom, like I did here. I can make a pull request for that if you want.