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

add delay that that prevent watchdog to crash #901

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

clecle253
Copy link

No description provided.

@clecle253
Copy link
Author

Hello, I'm using your library on a project which uses an ESP32 with esp-idf and arduino.

During the dev I encountered an issue with the connect() function:
The while (!_client->available()) loop can sometimes loop very quickly. While that's no issue on some MCUs, the esp32 has a task watchdog system: a thread cannot take 100% of the cpu time, and needs to yield once in a while, or the code will crash.

This PR adds a 1ms delay between retries to give time to other threads to do their work, thus fixing the problem.

@Flole998
Copy link

Most likely what you really want is to yield().

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.

2 participants