Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cores/esp32/esp32-hal-ledc.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,13 @@ void analogWrite(uint8_t pin, int value) {
return;
}
ledcAttachPin(pin, channel);
pin_to_channel[pin] = channel;
pin_to_channel[pin] = channel + 1;
ledcWrite(channel, value);
}
}

int8_t analogGetChannel(uint8_t pin) {
return pin_to_channel[pin];
return pin_to_channel[pin] - 1;
}

void analogWriteFrequency(uint32_t freq) {
Expand Down