Ok now it’s time to solve that. We have some customers that need to have this feature.
The power off button is connected on IO17 as an input port.
The wake up button is IO18 as interuptport.
As I already said LCD pins are used for other purpose in my product. Any way I can do something like:
Configuration.LCD.Configurations c = new Configuration.LCD.Configurations(800, 600, true, false, false, false, false, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 1);
Configuration.LCD.Set(c);
But this has no effect after 5 second the board reboot
GHI.Premium.Hardware.LowLevel.Watchdog.Enable(5000);
tab_V[channel].affect(true);
bpc.list_of_bpc[1].in_port.Dispose(); // this dispose IO18 previously declared as Inputport.
InterruptPort bp = new InterruptPort(GHI.Hardware.EMX.Pin.IO18, true, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeBoth);
Thread.Sleep(100);
bp.EnableInterrupt();
bp.OnInterrupt += new NativeEventHandler(bp_on_interupt);
Configuration.LCD.Configurations c = new Configuration.LCD.Configurations(800, 600, true, false, false, false, false, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 1);
Configuration.LCD.Set(c);
Debug.Print("Hibernate");
Power.Hibernate(Power.WakeUpInterrupt.InterruptInputs);
public static void bp_on_interupt(uint port, uint state, DateTime time)
{
Debug.Print("Wakup");
//PowerState.RebootDevice(false);
}