TheDIYGuy999 / Rc_Engine_Sound_ESP32

Allows to play vehicle engine sounds on an ESP32. Additional sounds can play in parallel with the engine sound! Controls your lights as well. compatible with SBUS, IBUS, PWM, PPM and SUMD signals.
https://www.youtube.com/watch?v=s93yAAmEtbM&t=3s
309 stars 121 forks source link

Mutex type semaphores cannot be used from within interrupt service routines. #34

Open sp3esu opened 2 years ago

sp3esu commented 2 years ago

Hi.

While working on my modification of Sound Engine I got an issue that while reading some I2C sensors software crashed. After a small investigation, I found that the I2C driver fails in using semaphore. I found such note in the documentation: "Mutex type semaphores cannot be used from within interrupt service routines."

After removing semaphore usage in the interruption handler function everything is working fine. https://github.com/TheDIYGuy999/Rc_Engine_Sound_ESP32/blob/4f940f085a6c04f4c201149b9e84758c03eb0ac3/src/src.ino#L1070

Replace xSemaphoreCreateMutex with xSemaphoreCreateBinary is not making any change - software is still crashing.

This can lead to other unexpected issues, so I suggest changing the way how channels data is synchronized. I didn't figure out it yet by myself. If I find a way I'll create PR.

Best Regards! Gregor