I should probably rephrase: I have an EXTI IRQ, which is used both at normal runtime (basically, it's hooked up to keypad) and to wake the uC up. I'm looking for something, to determine within EXTI IRQ code if the uC was in STOP mode before IRQ happened or not.
Currently, I'm just checking the PLL status bits, and if it's off I assume this is due to uC being in STOP mode before, and reinitialize the peripherals. I was looking for some cleaner solution, as this seems a bit of a hack.
The STOP mode entry etc works just fine. The only thing is that all possible pending IRQs need to be menally cleared before WFI, and that includes SysTick.