Hey,
I`m evaluating the Industrial SDK for the AM335x. There is a smple, which I did not understand completly.
One taks is called every millisecond, a second one is called after this. So task1 is executed every ms and task2 after task1, but not after every call of task1.
this is what the task 2 does:
while (1)
{
unsigned int curr_port0_activity, curr_port1_activity;
static unsigned int prev_port0_activity = 0, prev_port1_activity = 0;
Task_sleep(25 * OS_TICKS_IN_MILLI_SEC);
curr_port0_activity = bsp_read_dword(ESC_ADDR_TI_PORT0_ACTIVITY);
curr_port1_activity = bsp_read_dword(ESC_ADDR_TI_PORT1_ACTIVITY);
if (prev_port0_activity != curr_port0_activity)
{
set_act0_led();
}
if (prev_port1_activity != curr_port1_activity)
{
set_act1_led();
}
Task_sleep(100 * OS_TICKS_IN_MILLI_SEC);
reset_act0_led();
reset_act1_led();
prev_port0_activity = curr_port0_activity;
prev_port1_activity = curr_port1_activity;
#if ESC_EEPROM_EMULATION
if (bsp_get_eeprom_update_status())
{
bsp_set_eeprom_update_status(0);
bsp_eeprom_emulation_flush();
}
#endif
}
so, task2 is sleeping sometimes very long, I want to know if the scheduler do not call a task if it is sleeping? And why does he know that?
Or is there maybee something other like semaphore (I dont know if)?
hope you understand what I want to know.
Thanks for your help.