private void WDTUnloaded(object sender, RoutedEventArgs e) { Console.WriteLine("watchdog exit.........."); //已经喂狗,退出是弹出提示 if (wdttimer.IsEnabled) { MessageBoxResult result = MessageBox.Show("是否终止看门狗?", "提示", MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No); if (result == MessageBoxResult.Yes) { wdttimer.Stop(); wdttimer = null; WatchDogManager.Instance.Timer = null; WatchDogManager.Instance.WatchDog = null; if (watchdog != null) { if (watchdog.MinipcType.Equals("Q500")) { watchdog.StopWatchDog(0xf1, 0x40); } else { watchdog.StopWatchDog(0x72, 0x80); } watchdog.SysDispose(); watchdog = null; } } } }
private void GPIO_Unloaded(object sender, RoutedEventArgs e) { if (gpio != null) { gpio.SysDispose(); } }