Resolved! conditional transition to sleep mode
In many aplications i am using simple template, where interrupt routines (for example UART receive) raise flags (volatile variables) and main() function polling these flags and processing these events (for example parsing incoming UART charaters). I ...