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

Adapting timeout while-loop in Wire.cpp #317

Closed

Conversation

Frederik-Wagner
Copy link
Contributor

Error: Wire.cpp got stocked in the while-loop for the timeout since the timeout-condition was not defined as it should be per definition. It was not possible to leave the while-loop after the timeout-variable reached 0.

Change: Now, the checking condition was reduced to the essentials (it was wrong before) and another if-condition, which checks if the timeout-variable reached 0, was added inside the while-loop. This leads to a break.

Testing: The new wire.cpp was tested with the KIT_XMC_2GO_XMC1100_V1 & KIT_XMC47_RELAX_LITE_V1. Both worked.

@ederjc
Copy link
Member

ederjc commented Dec 2, 2024

@OlafFilies will check if we can run the HIL tests in this PR and @LinjingZhang & @jaenrig-ifx will peer-review.

delay(1);
timeout--;
if (timeout == 0) {
Serial.println("Warning Timeout");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not using stdout errors/warning here in this class (anywhere else) or? so to keep in consistent let´s remove the Serial.println("Warning Timeout");

Copy link
Collaborator

@LinjingZhang LinjingZhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No comment on the code. Just change the part Juan mentioned 😄
I would like to run HIL test for wire and 3d magnetic for this change.

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

Successfully merging this pull request may close these issues.

4 participants