Skip to content

Commit 331f25c

Browse files
committed
Changed to Mutex Semaphore
Using a Mutex semaphore is more appropriate in this case, for protecting (mutual exclusion) a hardware resource. Binary semaphores are used more properly to transfer control between an Interrupt and a Task.
1 parent 15fc40a commit 331f25c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/GoldilocksAnalogueTestSuite/GoldilocksAnalogueTestSuite.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void setup() {
102102
// But they should only be used whilst the scheduler is running.
103103
if ( xSerialSemaphore == NULL ) // Check to see if the Serial Semaphore has not been created.
104104
{
105-
xSerialSemaphore = xSemaphoreCreateBinary(); // binary semaphore for Serial Port
105+
xSerialSemaphore = xSemaphoreCreateMutex(); // mutex semaphore for Serial Port
106106
if ( ( xSerialSemaphore ) != NULL )
107107
xSemaphoreGive( ( xSerialSemaphore ) ); // make the Serial Port available
108108
}

0 commit comments

Comments
 (0)