From a566c693d9fbea5f97137b8a92e36b76cb05226e Mon Sep 17 00:00:00 2001 From: Henry Gabryjelski Date: Tue, 11 Aug 2020 20:20:49 -0700 Subject: [PATCH] With no ISR, use Mutex (not Binary) semaphore --- cores/nRF5/Tone.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/nRF5/Tone.cpp b/cores/nRF5/Tone.cpp index ac85f27a..2b04688e 100644 --- a/cores/nRF5/Tone.cpp +++ b/cores/nRF5/Tone.cpp @@ -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);