Skip to content

Fixing infinite hang within 'noTone' if it is called before 'tone' #449

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

Merged
merged 1 commit into from
Sep 16, 2019

Conversation

aentinger
Copy link
Contributor

tone need to run at least once in order to enable GCLK for the timers used for the tone-functionality. If noTone is called without ever calling tone before then WAIT_TC16_REGS_SYNC(TCx) will wait infinitely. The variable firstTimeRunning is set the 1st time tone is set so it can be used to detect wether or not tone has been called before. Fixes #326 .

@aentinger aentinger requested a review from facchinm September 16, 2019 09:01
@facchinm
Copy link
Member

While not amused by the name of firstTimeRunning variable, the fix is fine 🙂

@facchinm facchinm merged commit d2de78a into master Sep 16, 2019
@aentinger aentinger deleted the execute-notone-only-after-tone branch September 16, 2019 09:33
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.

Bug when calling noTone() before tone
2 participants