With no ISR, use Mutex (not Binary) semaphore

This commit is contained in:
Henry Gabryjelski committed 2020-08-11 20:20:49 -07:00
1 parent 2019117295
commit a566c693d9
1 file changed
+1 -1
+1 -1
View File
@@ -184,7 +184,7 @@ void tone(uint8_t pin, unsigned int frequency, unsigned long duration)
// and to simplify ensuring the semaphore gets initialized.
static StaticSemaphore_t _tone_semaphore_allocation;
static auto init_semaphore = [] () throw() { //< use a lambda to both initialize AND give the mutex
SemaphoreHandle_t handle = xSemaphoreCreateBinaryStatic(&_tone_semaphore_allocation);
SemaphoreHandle_t handle = xSemaphoreCreateMutexStatic(&_tone_semaphore_allocation);
auto mustSucceed = xSemaphoreGive(handle);
(void)mustSucceed;
NRFX_ASSERT(mustSucceed == pdTRUE);