Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage of Wire.requestFrom() and bug with local scope of buffer. #11

Open
Koepel opened this issue Sep 9, 2017 · 0 comments
Open

Usage of Wire.requestFrom() and bug with local scope of buffer. #11

Koepel opened this issue Sep 9, 2017 · 0 comments

Comments

@Koepel
Copy link

Koepel commented Sep 9, 2017

Hi, I don't know the purpose of this "dump" repository, but I noticed some issues. With a casual glance, you probably can spot them immediate when looking at the code.

In the file "dump/arduino/ard-04/lilypod.ino", the while-loop between Wire.requestFrom() and the Wire.read()s is not needed. There is not need to wait for something.

In the file "dump/arduino/ard-06/hmc5883l.cpp", in the function "Read()", the Wire.requestFrom() should not have the Wire.beginTransmission() and Wire.endTransmission(). A serious bug is the pointer that is returned, because the buffer is out of scope as soon as the function returns. A quick and dirty fix is to make the buffer static. It's dirty, I know.
There is no original for the loveelectronics.co.uk code on github. I also mentioned the issue here: landis/arduino#2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant