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

Tone limit 20KHz #7179

Merged
merged 7 commits into from
Apr 4, 2020
Merged

Tone limit 20KHz #7179

merged 7 commits into from
Apr 4, 2020

Conversation

Tech-TX
Copy link
Contributor

@Tech-TX Tech-TX commented Apr 1, 2020

Add 2 comments since I found out where the 5KHz upper limit on Tone output frequency was, apparently added for compatibility with the Arduino library some time in the past.

If you want the full 20KHz audio frequency range, change the two lines in Tone.cpp at line 38 to:

  high = std::max(high, (uint32_t)25);  // new 20KHz maximum Tone frequency
  low = std::max(low, (uint32_t)25);

Copy link
Collaborator

@earlephilhower earlephilhower left a comment

Choose a reason for hiding this comment

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

Thanks for the add'l comment, but I can see no reason not to extend the range by default to 20kHz like you were mentioning.

cores/esp8266/Tone.cpp Outdated Show resolved Hide resolved
@Tech-TX
Copy link
Contributor Author

Tech-TX commented Apr 1, 2020

Done, and done! I'll good with removing artificial restraints on operation. 😄
Travis CI running now.

@Tech-TX
Copy link
Contributor Author

Tech-TX commented Apr 2, 2020

FYI, I've already tested this change yesterday much farther than 20KHz. When I tried to take it to 65535 it blew up, but I sort of expected that based on your notes elsewhere about CPU utilization at 40KHz PWM.

Copy link
Collaborator

@earlephilhower earlephilhower left a comment

Choose a reason for hiding this comment

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

Thx!

@Tech-TX Tech-TX changed the title Tone limit comments Tone limit 20KHz Apr 3, 2020
@earlephilhower earlephilhower merged commit c548958 into esp8266:master Apr 4, 2020
@Tech-TX Tech-TX deleted the tone_limit_comments branch April 4, 2020 17:20
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.

None yet

3 participants