ESP32: ledcSetup before ledcAttach

This commit is contained in:
Harald Barth 2023-07-17 02:22:35 +02:00
parent 6476a7aac2
commit 6036ff9b15
1 changed files with 1 additions and 1 deletions

View File

@ -180,8 +180,8 @@ void DCCTimer::DCCEXanalogWrite(uint8_t pin, int value) {
return;
}
pin_to_channel[pin] = --cnt_channel;
ledcAttachPin(pin, cnt_channel);
ledcSetup(cnt_channel, 1000, 8);
ledcAttachPin(pin, cnt_channel);
} else {
ledcAttachPin(pin, pin_to_channel[pin]);
}