/usr/bin/avos:mainloop enter()
From ArchosDocs
Description
This is the main program loop. It gives time to timers and process event messages.
The Code
function mainloop_enter() {
// oversimplified
while(true) {
Timers_nextTimeout(&gui_timers);
if(!service_data_events())
exit();
// handle each message in the message queue
while(MESSAGE_GetNum() > 0) {
m = MESSAGE_Get();
if(m) message_handler_handle(m);
}
Timers_trigger(&gui_timers);
}
}

