Weakup from Hibernate mode in FEZ Cobra

I am working with FEZ Cobra for low power mode using Hibernate. The written code is as under.

            InterruptPort LDR = new InterruptPort((Cpu.Pin)23, true, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);
            RealTimeClock.SetTime(new DateTime(2010, 1, 1, 1, 1, 1));
            Power.Hibernate(Power.WakeUpInterrupt.RTCAlarm | Power.WakeUpInterrupt.InterruptInputs);

After executing the code, it is successfully weak up from RTCAlarm interrupt and from Interrupt Inputs.

My question is, after weak-up, how to get that the weak-up is from RTCAlarm Interrupt or from interrupt Inputs?

I am not exactly sure how plus there may not be a direct way of doing so.

Maybe use “register” class to read the ALARM registers directly? You will need to look at the processor manual http://www.nxp.com/documents/user_manual/UM10237.pdf

I have gone through the processor manual, The 15th bit of interrupt weak-up register (INTWAKE - address 0xE01F C144) is for RTCWAKE, when it is one the interrupt will weak-up the processor from Power down mode.

I have tried reading that register but it is giving 0 value when it weak-up from power down mode. any other suggestion please.

Maybe you need top take a look at the peripheral registers. They might have some indicators of what what the first thing that happened after the wake up. For example the RTC might have that status register that indicates that the Alarm signal has been fired.

I have tried but didn’t get RTC status for interrupt, but my problem is resolve. I got Interrupt input status from Interrupt input object.Read() function, it gives the last status of interrupt.