Пример #1
0
 private void InitializeInterruptDriver()
 {
     try
     {
         _interruptDriver = new LibGpiodDriver(0);
     }
     catch (PlatformNotSupportedException)
     {
         _interruptDriver = new InterruptSysFsDriver(this);
     }
 }
Пример #2
0
 protected override void Dispose(bool disposing)
 {
     if (_registerViewPointer != null)
     {
         Interop.munmap((IntPtr)_registerViewPointer, 0);
         _registerViewPointer = null;
     }
     if (_sysFSDriver != null)
     {
         _sysFSDriver.Dispose();
         _sysFSDriver = null;
     }
 }
Пример #3
0
 private void InitializeSysFS()
 {
     if (_sysFSDriver != null)
     {
         return;
     }
     lock (s_SysFsInitializationLock)
     {
         if (_sysFSDriver != null)
         {
             return;
         }
         _sysFSDriver = new UnixDriver();
     }
 }