I’m doing some work with a Domino. On other .net MF platforms I’ve worked with, interrupts are queued and the time parameter in the OnInterrupt event handler is the actual time of the interrupt, not the time that the event was fired.
I’m referring to the ‘time’ parameter in this little snippet of code…
using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using GHIElectronics.NETMF.FEZ;
using RC6_Remote;
namespace DominoRC6Decoder
{
public class Program
{
// Declare the interrupt port and it's handler
public static InterruptPort IR_in = new InterruptPort((Cpu.Pin)FEZ_Pin.Digital.Di7, true, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth);
public static void Main()
{
// Initialise the IR remote
RC6_Decoder.RemoteInputPin = IR_in;
RC6_Decoder.CodeReceived += new CodeReceivedEventHandler(RC6_Decoder_CodeReceived);
IR_in.OnInterrupt += new NativeEventHandler(IR_in_OnInterrupt);
// Now stop the main thread
Thread.Sleep(Timeout.Infinite);
}
static void IR_in_OnInterrupt(uint data1, uint data2, DateTime time)
{
RC6_Decoder.Record_Pulse(data1, data2, time);
}
static void RC6_Decoder_CodeReceived(int mode, ulong data)
{
Debug.Print("Received command. Mode = " + mode.ToString() + " ... Command = " + data.ToString());
}
}
}
On the Domino it seems that the events are queued but the time parameter in the event handler is the time that the event handler was called. Am I correct? Without the source I can’t prove that in any way, but logic analyser timings seem to indicate that this is the case.
If so, that’s a real pain as it rules out using the devices to decode Manchester encoded pulse streams (unless I write a C code interrupt handler). That should not be needed … for example, the same code works fine on a much slower NetDuino board.