Skip to content

Commit

Permalink
[HAL] Fix tone on ESP32 IDF > 5.0.0 (#1123)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgromes committed Jun 13, 2024
1 parent a8b6c38 commit 940eb07
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ArduinoHal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ void inline ArduinoHal::tone(uint32_t pin, unsigned int frequency, RadioLibTime_
if(prev == -1) {
#if !defined(ESP_IDF_VERSION) || (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5,0,0))
ledcAttachPin(pin, RADIOLIB_TONE_ESP32_CHANNEL);
#else
ledcAttach(pin, frequency, 14); // 14-bit resolution should be enough
#endif
}
if(prev != frequency) {
Expand Down

0 comments on commit 940eb07

Please sign in to comment.