Comparison of FreeRTOS Semaphores (Part Five)
Message queues/semaphores/mutexes can be further compared. The following APIs seem well-organized(in fact, their underlying implementations come from the same source~) QueueHandle_t xQueue = xQueueCreate(10, sizeof(int)); // Create a queuexQueueSend(xQueue, &data, portMAX_DELAY); // Send dataxQueueReceive(xQueue, &receivedData, portMAX_DELAY); // Receive data SemaphoreHandle_t xSemaphore = xSemaphoreCreateBinary(); // Create a binary semaphore xSemaphoreGive(xSemaphore); // Release the semaphore xSemaphoreTake(xSemaphore, portMAX_DELAY); … Read more