我无法stm32f4discovery
使用 VS2010 在 .NET 中编译代码。
使用NETMF 4.2
using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
namespace MFConsoleApplication1
{
public class Program
{
private static InterruptPort interruptPort;
public static void Main()
{
interruptPort = new InterruptPort(Cpu.Pin.GPIO_Pin2,
false,
Port.ResistorMode.PullUp,
rt.InterruptMode.InterruptEdgeLevelLow);
interruptPort.OnInterrupt += new NativeEventHandler(port_OnInterrupt);
Thread.Sleep(Timeout.Infinite);
}
private static void port_OnInterrupt(uint port, uint state, TimeSpan time)
{
Debug.Print("Pin=" + port + " State=" + state + " Time=" + time);
interruptPort.ClearInterrupt();
}
}
}
在编译时,我收到以下错误:
No overload for 'port_OnInterrupt' matches delegate 'Microsoft.SPOT.Hardware.NativeEventHandler'
我如何编译代码?
我从“Expert .NET Micro framework”一书中举了这个例子。