I'm developing a UI for embedded system application. I have to handle few critical tasks always which are being called in main infinite while() loop.
Program flow enters into sub-menu if key is pressed. Since sub-menu has its own infinite while() loop therefore control can not return back to main loop by on its own. It makes accessing of critical tasks impossible as long as sub-menu is active.
- Is there any way to serve tasks in sub loop which are being called in main loop only?
- One way of accessing is to call them in sub-loop as well. But I don't think its a right approach since UI has 50+ sub-menus and also does sub-loops.