Power.GetResetSource() doesn't give me the expected answer

Hello,

On my FEZ Pico, I am (successfully) using the Shutdown function like this:

        Power.WakeupEdge = WakeupEdge.Rising;
        Power.Shutdown(true, DateTime.Now.AddSeconds(10));

Is there any way to know if the board is restarted by the WKUP input or by the clock?
I tried the following, but that returns ‘ResetSource.Other’ in both cases:

        ResetSource resetSource = Power.GetResetSource();

Hi, will will look in next release. For now, you can check this link:

Check my last post, something like this:

....
     const uint PWR_SR1 = 0x40000000U + 0x7000U + 0x10;
     const uint PWR_SCR = 0x40000000U + 0x7000U + 0x18;

     // Read wakeup source -> Read must be done before clear or it will be set to 0.
     var wakeupSource  = Marshal.ReadInt32((IntPtr)PWR_SR1, 0);

     if ((wakeupSource & (1 << 0)) != 0)
     {
         Debug.WriteLine("Wk by PA0");
     }
     else if ((wakeupSource & (1 << 3)) != 0)
     {
         Debug.WriteLine("Wk by PA2");

     }
    else {
         Debug.WriteLine("Wk by rtc timer");
    }

    
    // Enter Shutdown
   .......

Thanks!
I’m going to try it :slight_smile: