For example, in MyApp_event_loop task. I have two events: one default sys_msg and one is my app. it looks like this
if ( events & SYS_EVENT_MSG )
{
//sys code
......
case KEY_CHANGE:
osal_set_event(MyApp_event_loop,MyApp_event);
}
if ( events & MyApp_event )
{
MyApp_process();
}
I have received a INT from HAL which trigger key change handler which set the event in MyApp_event, if code gets sequentially executed in task. so it will process MyApp_event immediately or it will go back to big loop in osal_start_system() to process events of other task and then come back?(I think it is former way, just make sure)
Also is it possible that compiler re-order the if statement so that the later if ( events & MyApp_event ) will be executed before if ( events & SYS_EVENT_MSG )?
thanks
Rui