Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow access to the PWM channel assigned to the Pin. Opportunity to change PWM configurations #6992

Merged
merged 5 commits into from
Jul 20, 2022
Merged
Show file tree
Hide file tree
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: 4 additions & 0 deletions cores/esp32/esp32-hal-ledc.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,7 @@ void analogWrite(uint8_t pin, int value) {
ledcWrite(pin_to_channel[pin] - 1, value);
}
}

int8_t analogGetChannel(uint8_t pin) {
return pin_to_channel[pin] - 1;
}
1 change: 1 addition & 0 deletions cores/esp32/esp32-hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ void yield(void);
#include "esp32-hal-cpu.h"

void analogWrite(uint8_t pin, int value);
int8_t analogGetChannel(uint8_t pin);

//returns chip temperature in Celsius
float temperatureRead();
Expand Down