Specifically, what happens if I create 3 tasks of the same priority? Which one gets the message, when I make a system_os_post call?
As an example, I created 3 tasks with the same priority.
system_os_task(WIFI_Connection, WIFI_TASK_PRIO, wifi_procTaskQueue, WIFI_TASK_QUEUE_SIZE);
system_os_task(WIFI_Connection1, WIFI_TASK_PRIO, wifi_procTaskQueue, WIFI_TASK_QUEUE_SIZE);
system_os_task(WIFI_Connection2, WIFI_TASK_PRIO, wifi_procTaskQueue, WIFI_TASK_QUEUE_SIZE);
And then in a timer, make following calls:
system_os_post(WIFI_TASK_PRIO, 0xAB, (os_param_t)0);
system_os_post(WIFI_TASK_PRIO, 0xCD, (os_param_t)0);
system_os_post(WIFI_TASK_PRIO, 0xEF, (os_param_t)0);
And my tasks do nothing but the following:
void ICACHE_FLASH_ATTR WIFI_Connection(os_event_t *e)
{
if(e->sig == 0xAB)
{
os_printf("WIFI_Connection 0xAB\r\n");
}
}
void ICACHE_FLASH_ATTR WIFI_Connection1(os_event_t *e)
{
if(e->sig == 0xCD)
{
os_printf("WIFI_Connection1 0xCD\r\n");
}
}
void ICACHE_FLASH_ATTR WIFI_Connection2(os_event_t *e)
{
if(e->sig == 0xEF)
{
os_printf("WIFI_Connection2 0xEF\r\n");
}
}
What happens is, only the last "created" task gets the post. The others are not invoked at all.
Can somebody help me understand this?
What is the purpose of having a "sig" parameter in
system_os_post(uint8 prio, os_signal_t sig, os_param_t par);