Exemplo n.º 1
0
 /// <summary>
 /// This is a timer responder. Each time a bit is received, the timer is reset. If no bits are received after a
 /// period defined by the rc_timeout constant in this class then the quiet time is deemed to have elapsed
 /// and the received pulse train will be decoded.
 /// </summary>
 /// <param name="o"></param>
 static void RCtimeout(object o)
 {
     // Disable the RC interrupt, process the command, clear the buffers then re-enable the interrupt
     intervals[pos]    = DateTime.Now.Ticks / 10;
     signalStates[pos] = RemoteInputPin.Read();
     RCtimeoutTimer.Change(Timeout.Infinite, Timeout.Infinite);  // Stop the timer
     RC6_Decoder.Decode(intervals, signalStates);
     pos          = 0;
     intervals    = new long[256];           // The garbage collector is going to need to run for this at some point!
     signalStates = new Boolean[256];        // But when? Probably in the middle of an interrupt. This bad code! :^)
 }
Exemplo n.º 2
0
 // Event handler for the RC6 pin's code event. Just pass everything to the handler in the RC6 decoder class
 static void RC_In_OnInterrupt(uint data1, uint data2, DateTime time)
 {
     RC6_Decoder.Record_Pulse(data1, data2, time);
 }