Hi guys,
I have a weird behavior when implementing the sleep mode with the new netmf 4.3 on my G120.
I implement something very similar to this:
using Microsoft.SPOT.Hardware;
using System;
public class Program
{
public static void Main()
{
var interrupt = new InterruptPort(Cpu.Pin.GPIO_Pin0, true, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeHigh);
interrupt.OnInterrupt += interrupt_OnInterrupt;
PowerState.Sleep(SleepLevel.DeepSleep, HardwareEvent.OEMReserved1);
///Continue on with your program here
}
private static void interrupt_OnInterrupt(uint data1, uint data2, DateTime time)
{
//Interrupted
}
}
The difference is that I have an “inactivity” counter that puts my device in sleep mode if the user has no interaction with it after a given amount of time - meaning the Sleep command is in a seperate thread, and not in the main loop - and my interrupt port is declared like this:
powerDown_resume = new InterruptPort((Cpu.Pin)G120.P2_11, true, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);
powerDown_resume.OnInterrupt += powerDown_resume_OnInterrupt;
I works fine: after that given amount of time, the device enters in suspend mode, and, when I push the button connected to the interrupt port, it resumes, as expected.
After another inactivity period, the device goes back to sleep, as expected, but, for some reason, it wakes up by itself after 2 seconds, without having pushed any buttons.
My questions are:
With the new netmf 4.3, do we need to clear the interrupts?
Does the glitch filter works ?
By the way, my hardware works, it used to work with the same code running out netmf 4.2 (the Hibernate has been replace by PowerState.Sleep).
Thanks.