1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

Tone limit 20KHz (#7179)

Set Tone maximum frequency to 20KHz (was 5KHz)
This commit is contained in:
StanJ 2020-04-04 11:47:54 -05:00 committed by GitHub
parent 483bfde885
commit c548958f6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;