Temp fix for ledcReadFreq()

This commit is contained in:
Stephan Hadinger 2022-08-02 23:21:12 +02:00
parent abf352c8f8
commit 4dc6adf37f
3 changed files with 4 additions and 4 deletions

View File

@ -318,8 +318,8 @@ int32_t analogAttach(uint32_t pin, bool output_invert) { // returns ledc chan
return chan;
}
// uint32_t ledcReadFreq2(uint8_t chan) {
extern "C" uint32_t __wrap_ledcReadFreq(uint8_t chan) {
extern "C" uint32_t ledcReadFreq2(uint8_t chan) {
// extern "C" uint32_t __wrap_ledcReadFreq(uint8_t chan) {
if (chan > MAX_PWMS) {
return 0; // wrong channel
}

View File

@ -43,7 +43,7 @@
* So it all happens like if there were only 4 timers and a single group of PWM channels.
\*******************************************************************************************/
extern "C" uint32_t ledcReadFreq(uint8_t chan);
extern "C" uint32_t ledcReadFreq2(uint8_t chan);
uint8_t ledcReadResolution(uint8_t chan);
//
// analogAttach - attach a GPIO to a hardware PWM

View File

@ -85,7 +85,7 @@ void PwmApplyGPIO(bool force_update_all) {
int32_t chan = analogGetChannel2(pin);
uint32_t res = ledcReadResolution(chan);
uint32_t range = (1 << res) - 1;
uint32_t freq = ledcReadFreq(chan);
uint32_t freq = ledcReadFreq2(chan);
// AddLog(LOG_LEVEL_INFO, "PWM: res0=%i freq0=%i pin=%i chan=%i res=%i timer=%i range=%i freq=%i", timer0_resolution, timer0_freq, pin, chan, res, analogGetTimerForChannel(chan), range, freq);