mirror of https://github.com/arendst/Tasmota.git
Temp fix for ledcReadFreq()
This commit is contained in:
parent
abf352c8f8
commit
4dc6adf37f
|
@ -318,8 +318,8 @@ int32_t analogAttach(uint32_t pin, bool output_invert) { // returns ledc chan
|
||||||
return chan;
|
return chan;
|
||||||
}
|
}
|
||||||
|
|
||||||
// uint32_t ledcReadFreq2(uint8_t chan) {
|
extern "C" uint32_t ledcReadFreq2(uint8_t chan) {
|
||||||
extern "C" uint32_t __wrap_ledcReadFreq(uint8_t chan) {
|
// extern "C" uint32_t __wrap_ledcReadFreq(uint8_t chan) {
|
||||||
if (chan > MAX_PWMS) {
|
if (chan > MAX_PWMS) {
|
||||||
return 0; // wrong channel
|
return 0; // wrong channel
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
* So it all happens like if there were only 4 timers and a single group of PWM channels.
|
* 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);
|
uint8_t ledcReadResolution(uint8_t chan);
|
||||||
//
|
//
|
||||||
// analogAttach - attach a GPIO to a hardware PWM
|
// analogAttach - attach a GPIO to a hardware PWM
|
||||||
|
|
|
@ -85,7 +85,7 @@ void PwmApplyGPIO(bool force_update_all) {
|
||||||
int32_t chan = analogGetChannel2(pin);
|
int32_t chan = analogGetChannel2(pin);
|
||||||
uint32_t res = ledcReadResolution(chan);
|
uint32_t res = ledcReadResolution(chan);
|
||||||
uint32_t range = (1 << res) - 1;
|
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);
|
// 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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue