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.NETMicroframework」という本から引用したものです。