未验证 提交 cc8f4e5a 编写于 作者: V Vasko 提交者: GitHub

Allow access to the PWM channel assigned to the Pin. Opportunity to change PWM...

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: NRodrigo Garcia <rodrigo.garcia@espressif.com>
Co-authored-by: NJan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>
上级 e55a1beb
......@@ -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();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册