Final fix

This commit is contained in:
Theo Arends 2024-02-16 20:10:55 +01:00
parent 733b9254a5
commit 7216db339e
1 changed files with 4 additions and 2 deletions

View File

@ -324,13 +324,15 @@ int32_t analogAttach(uint32_t pin, bool output_invert) { // returns ledc chan
}
void analogDetach(void) {
#if ESP_IDF_VERSION_MAJOR < 5
for (uint32_t pin = 0; pin < SOC_GPIO_PIN_COUNT; pin++) {
if (pin_to_channel[pin] > 0) {
#if ESP_IDF_VERSION_MAJOR < 5
ledcDetachPin(pin);
#else
ledcDetach(pin);
#endif
}
}
#endif
}
extern "C" uint32_t ledcReadFreq2(uint8_t chan) {