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

Update esp32_ledc_mcu.cpp to ensure ledc_timer is initialised to a known state (ledc_timer = false) #447

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rob-deutsch
Copy link
Contributor

@rob-deutsch rob-deutsch commented Jan 17, 2025

Need to set this uninitialised piece of memory, otherwise ledc_timer_config() might try to call ledc_timer_del() and that will fail.

@rob-deutsch rob-deutsch changed the title Update esp32_ledc_mcu.cpp to set ledc_timer = false Update esp32_ledc_mcu.cpp to set ledc_timer.deconfigure = false Jan 17, 2025
@askuric
Copy link
Member

askuric commented Jan 20, 2025

Thanks for this!
This seems to be a API change actually going from the espressif 5.1 to 5.2
Introducing the deconfigure might actually break the code for people with v3.0.x of the arduino-esp32 which depends on espressif 5.1.4. So we will have to handle this with care 😄

ledc_timer_config_t definition

Could you just confirm which version of espressif and ardunio-esp32 are you using?

@rob-deutsch
Copy link
Contributor Author

Oh good pickup. I'm actually using pioarduino because espressif/arduino-esp32 doesn't seem to support platformio any more.

Maybe the simplest way forward is to calloc/memset ledc_timer_config_t to 0 based on its size?

@rob-deutsch rob-deutsch changed the title Update esp32_ledc_mcu.cpp to set ledc_timer.deconfigure = false Update esp32_ledc_mcu.cpp to ensure ledc_timer is initialised to a known state (ledc_timer = false) Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants