.net core .net core 3.1从VS 2019 CE到Raspberry PI的远程调试-当应用程序想要处理GPIO中断时,vsdbg退出
我的应用程序使用Unosquare.Raspberry.IO和Unosquare.WiringPi nuget包处理Raspberry PI 3B+上的GPIO中断。由于它必须处理多个中断,因此它为每个中断设置一个任务,然后等待生成的任务列表 中断的设置如下所示:.net core .net core 3.1从VS 2019 CE到Raspberry PI的远程调试-当应用程序想要处理GPIO中断时,vsdbg退出,.net-core,raspberry-pi,.net Core,Raspberry Pi,我的应用程序使用Unosquare.Raspberry.IO和Unosquare.WiringPi nuget包处理Raspberry PI 3B+上的GPIO中断。由于它必须处理多个中断,因此它为每个中断设置一个任务,然后等待生成的任务列表 中断的设置如下所示: public async Task StartCounterAsync(CancellationToken cancelToken) { logger.LogInformation($"Starting
public async Task StartCounterAsync(CancellationToken cancelToken)
{
logger.LogInformation($"Starting Counter {counterName}");
var counterPin = Pi.Gpio[inputPin];
counterPin.PinMode = GpioPinDriveMode.Input;
counterPin.RegisterInterruptCallback(EdgeDetection.RisingEdge, HandleCounterInterrupt);
await cancelToken;
}
private void HandleCounterInterrupt()
{
logger.LogInformation("HandleCounterInterrupt");
}
}
当我在raspi上通过ssh启动应用程序时,应用程序运行良好,中断处理工作没有任何问题。
如果我通过“DebugAdapterHost.launch/LaunchJson:launch.json”启动应用程序,它将正常运行,直到我按下按钮创建中断为止。然后vsdgb简单地退出:
1> [DebugAdapter] <-- E (thread): {"seq":97,"type":"event","event":"thread","body":{"reason":"started","threadId":1340}}
*** Here I press the button ***
1> [DebugAdapter] <-- E (exited): {"seq":98,"type":"event","event":"exited","body":{"exitCode":0}}
1> [DebugAdapter] <-- E (terminated): {"seq":99,"type":"event","event":"terminated","body":{}}
1> [DebugAdapter] --> C (disconnect-15): {"type":"request","command":"disconnect","arguments":{},"seq":15}
{
"version": "0.2.0",
"adapter": "plink.exe",
"adapterArgs": "-i C:/Users/ur/source/repos/devpikey.ppk root@devpi -batch -T /home/pi/vsdbg/vsdbg --interpreter=vscode",
"configurations": [
{
"name": ".NET Core Launch",
"type": "coreclr",
"cwd": "/home/pi/PiS0Counter",
"program": "/home/pi/dotnet-arm32/dotnet",
"args": "PiS0Counter.dll",
"request": "launch"
}
]
}