-
Notifications
You must be signed in to change notification settings - Fork 603
Update esp32_ledc_mcu.cpp to ensure ledc_timer is initialised to a known state (ledc_timer = false) #447
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
Conversation
Thanks for this!
Could you just confirm which version of espressif and ardunio-esp32 are you using? |
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? |
…own state (ledc_timer = false)
Any thoughts on why the tests are failing? I didn't change anything which should break those tests, and the error message isn't clear to me. |
It was unrelated to your change and I have fixed it.
So how should we handle it? I must say I find the current situation with ESP32 very confusing. Some boards still work with the old framework versions, also in platformio. Other boards (C6, C5, P4) require the new framework. The new framework official release doesn't work in PlatformIO, but the new pioarduino framework does. |
Good question - the updated branch I forced push will work across any and all versions of arduino-esp32 and pioarduino. It's entirely cross platform because it just inits the struct to zeroes. I would suggest merging this PR and tackling the question about ESP32 compatability elsewhere.
I also find the current situation confusing. It's an unfortunate situation that seems to be caused by Espressif no longer supporting platformio in arduino-esp32. I don't yet have a strong POV as to what the right thing to do is. I'm sure that simplefoc isn't the only one facing this problem. |
I suspect that's an accidental addition of a linefeed (LF) character at the end of the line. Would you like me to submit a PR which removes this additional LF character? |
No, thanks for offering this, but I have already merged it :-) I made the mistake of merging it to master, doh! That's what I actually should have checked, but never mind. Its really just a small change, and I'll fix all this in time for the next release... |
Sorry about that, I should've spotted it before submitting the PR. Thanks for your understanding. |
Need to set this uninitialised piece of memory, otherwise ledc_timer_config() might try to call ledc_timer_del() and that will fail.