本文整理汇总了C#中Microsoft.SPOT.Hardware.InterruptPort.ClearInterrupt方法的典型用法代码示例。如果您正苦于以下问题:C# InterruptPort.ClearInterrupt方法的具体用法?C# InterruptPort.ClearInterrupt怎么用?C# InterruptPort.ClearInterrupt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.SPOT.Hardware.InterruptPort
的用法示例。
在下文中一共展示了InterruptPort.ClearInterrupt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PushButton
/// <summary>
/// PushButton constructor.
/// </summary>
/// <param name="pin">GPIO input pin</param>
/// <param name="callback">Callback delegate</param>
/// <param name="resmode">Resistor mode</param>
public PushButton(Cpu.Pin pin, NativeEventHandler callback, Port.ResistorMode resmode)
{
Port.InterruptMode imode = resmode == Port.ResistorMode.PullUp ?
Port.InterruptMode.InterruptEdgeLow : Port.InterruptMode.InterruptEdgeHigh;
m_interruptPort = new InterruptPort(pin, true, resmode, imode);
if (callback != null) {
m_interruptPort.OnInterrupt += callback;
}
// default behavior is to always clear interrupt
m_interruptPort.OnInterrupt += new NativeEventHandler((uint port, uint state, DateTime time) => {
m_interruptPort.ClearInterrupt();
});
}