Code: Select all
void app_main()
{
...
systemEvtQueue = xQueueCreate(10, sizeof(uint8_t));
...
}
static void task1(void *pvParameters)
{
uint8_t event = 0;
while (1)
{
event = 3;
xQueueSend(systemEvtQueue, (void *)&event, (TickType_t)0);
ESP_LOGI(__func__, "Sending event %i", event);
vTaskDelay(1000 / portTICK_PERIOD_MS);
}
}
static void task2(void *pvParameters)
{
uint8_t event = 0;
while (1)
{
if (xQueueReceive(systemEvtQueue, (void *)&event, (TickType_t)0))
{
ESP_LOGI(__func__, "Received event %i", event);
}
vTaskDelay(100 / portTICK_PERIOD_MS);
}
}