I have problems with hibernation and IO50 on USBizi100
Depending on the pin configurations( especially InterruptMode ), the board hangs before or after hibernate.
In the code bellow, the board will freeze before hibernate if the pin was grounded before, or after hibernate, if the pin will be grounded after hibernation.
The board will crash even if the inputEINT3 is not created and the pin has changed the state during hibernation .
using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using System.Threading;
using GHIElectronics.NETMF.Hardware.LowLevel;
using GHIElectronics.NETMF.Hardware;
namespace MFTestExtInt3
{
public class Program
{
static InterruptPort inputEINT3;
static InterruptPort inputGood;
static OutputPort LED = new OutputPort(USBizi.Pin.IO69, true);
public static void Main()
{
Thread.Sleep(7000);
inputGood = new InterruptPort(USBizi.Pin.IO10, true, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeHigh);
inputEINT3 = new InterruptPort(USBizi.Pin.IO50, true, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeHigh);
while (true)
{
LED.Write(false);
GHIElectronics.NETMF.Hardware.LowLevel.Power.Hibernate(Power.WakeUpInterrupt.InterruptInputs);
//blinking led
for (int j = 0; j < 5; j++)
{
LED.Write(j % 2 == 0);
Thread.Sleep(300);
}
}
}
}
}
Cosmin