Skip to content

Commit

Permalink
Tone limit 20KHz (#7179)
Browse files Browse the repository at this point in the history
Set Tone maximum frequency to 20KHz (was 5KHz)
  • Loading branch information
Tech-TX committed Apr 4, 2020
1 parent 483bfde commit c548958
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cores/esp8266/Tone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ static void _startTone(uint8_t _pin, uint32_t high, uint32_t low, unsigned long

pinMode(_pin, OUTPUT);

high = std::max(high, (uint32_t)100);
low = std::max(low, (uint32_t)100);
high = std::max(high, (uint32_t)25); // new 20KHz maximum tone frequency,
low = std::max(low, (uint32_t)25); // (25us high + 25us low period = 20KHz)

if (startWaveform(_pin, high, low, (uint32_t) duration * 1000)) {
_toneMap |= 1 << _pin;
Expand Down

0 comments on commit c548958

Please sign in to comment.