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

Everything freezes when I2C device loses power #1

Open
Combinacijus opened this issue Jul 2, 2019 · 0 comments
Open

Everything freezes when I2C device loses power #1

Combinacijus opened this issue Jul 2, 2019 · 0 comments

Comments

@Combinacijus
Copy link

As mentioned here:
https://arduino.stackexchange.com/questions/30353/i2c-connection-freezes-master-if-slave-disconnects

It looks like the problem is that code gets into infinite loop. So I narrowed down problem to twi.cpp:
libraries/Wire/utility/twi.cpp

In twi.cpp I have commented out all while and do while loops and after that code don't freeze anymore so it must be problem in those loops BUT code doesn't work because those loops delay code execution until required processes finishes.

Proposed solution:
In twi.cpp file add timeout to all while and do while loops (assuming all loops are causing the problem)

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