User Activity

In my system, I initialised two interrupts for wake-up from STOP2 mode, after exiting STOP2 mode, how do I know that the system is waking up by RTC timer or interrupt pin? Is there any variable that I can check after waking up to find the reason why ...
I do have problem to check wake up flag after wake-up from RTC timer or interrupt pin. This is my code block to check flag after wake-up:  void InitiateMode(int timeValue) { turnOffPeripherals(); timeValue = getTimeValue(timeValue); printf("\ng...
Kudos given to