mirror of
https://github.com/espressif/arduino-esp32
synced 2024-09-21 18:38:17 +00:00
Allow access to the PWM channel assigned to the Pin. Opportunity to change PWM configurations (#6992)
* Get channel assigned to the pin with analogWrite * Respect coding standard in LEDC source file Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>
This commit is contained in:
parent
e55a1bebf0
commit
cc8f4e5af6
@ -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;
|
||||
}
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user