-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Missing vSemaphoreDelete() in arduino-esp32/cores/esp32/ #6540
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
Comments
I would love to hear some feedback from the devs, or anybody, if this is a good addition to this project. |
Hi @mrengineer7777, thanks for suggestion. What do you think @me-no-dev? |
Bump. Still willing to do the work on this if it helps. |
thanks for reminder @mrengineer7777! I'm adding this feature request to the roadmap and we will evaluate this. |
Hello, Due to the overwhelming volume of issues currently being addressed, we have decided to close the previously received tickets. If you still require assistance or if the issue persists, please don't hesitate to reopen the ticket. Thanks. |
Board
Any
Device Description
NA
Hardware Configuration
NS
Version
latest master
IDE Name
PlatformIO
Operating System
Win10
Flash frequency
80
PSRAM enabled
no
Upload speed
115200
Description
This is a proposed bugfix and feature improvement. In #6425 it was discovered that esp32-ha-spi.c never releases the Mutex created in spiStartBus(). Looking at the other libraries in arduino-esp32/cores/esp32/, I can see that the same issue occurs in:
esp32-hal-i2c.c
esp32-hal-i2c-slave.c
esp32-hal-spi.c
esp32-hal-uart.c
esp32-hap-cpu.c [There isn't a matching function to initApbChangeCallback() to release the Mutex]
Everything except the CPU file uses the Mutex when CONFIG_DISABLE_HAL_LOCKS==false. The code is littered with
#if !CONFIG_DISABLE_HAL_LOCKS
, which makes it difficult to read and maintain. While I could edit each file and add the missing vSemaphoreDelete() calls, I propose creating a unified set of defines in esp32-hal.h, and possibly a couple supporting function calls. Then we can use the new defines in the core libraries to simplify HAL locks.I'd be happy to create a PR if this would help.
Here's what I have so far. Keep in mind this is conceptual. Code has not been compiled or tested.
In esp32-hal.h:
Not sure where to put this:
USAGE:
Compare this to esp32-hal-uart.c:
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
Edit: renamed HalLocksCreateMutex() to HalLocksInit().
The text was updated successfully, but these errors were encountered: