[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  Electronics
. -> [Folder]  Microprocessors
. . -> [Subject]  bug in I2C_Anything.zip

bug in I2C_Anything.zip

Postings by administrators only.

[Refresh] Refresh page


Posted by Brian J. Murrell   (3 posts)  [Biography] bio
Date Fri 26 Jan 2018 05:42 PM (UTC)

Amended on Fri 26 Jan 2018 05:54 PM (UTC) by Brian J. Murrell

Message
Hi. I was most interested in your I2C_Anything implementation.

There does seem to be a meaningful discrepancy between what you wrote in your forum post at http://www.gammon.com.au/forum/?id=10896&reply=8#reply8 and what is in the library download you provide at the bottom of that post.

In the post, I2C_writeAnything() writes using:


Wire.write((byte *) &value, sizeof (value));


and in the library it writes using:


for (i = 0; i < sizeof value; i++)
      Wire.write(*p++);


Of course, you cannot use Wire.write() more than once in an
Wire.onRequest() event handler. The post reflects that but the library download needs updating to reflect that particularly since the download is likely what a significant number of people are going to use to get your templates.

Great work on those. Really happy to see your PR to the official project to get them included as part of the official Wire library.
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Fri 26 Jan 2018 09:53 PM (UTC)
Message
I've pushed the library to Github:


https://github.com/nickgammon/I2C_Anything

I suggest you open an issue there.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Brian J. Murrell   (3 posts)  [Biography] bio
Date Reply #2 on Fri 26 Jan 2018 09:58 PM (UTC)
Message
Ahh. Great. I looked for the library there before posting here but saw that it was not on your GitHub account.

And I see that you've already fixed the problem there but not in the copy that's at the link that is in the Forum post:

http://www.gammon.com.au/forum/?id=10896&reply=8#reply8

which is still going to lead people to installing a broken version of the library.
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Fri 26 Jan 2018 10:01 PM (UTC)
Message
Brian Murrell said:

There does seem to be a meaningful discrepancy between what you wrote in your forum post at http://www.gammon.com.au/forum/?id=10896&reply=8#reply8 and what is in the library download you provide at the bottom of that post.


Ah I see what you mean. The post was correct but the download was wrong. I've changed the download link to be the GitHub page which was the correct code (you can see the history in the commit history).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Fri 26 Jan 2018 10:04 PM (UTC)
Message
Thanks for the heads-up. :)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


16,342 views.

Postings by administrators only.

[Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]