Add support for Corsair Lighting Pro
[temp2RGB.git] / src / main_loop.rs
index 6e7dd74..ae4c221 100644 (file)
@@ -17,7 +17,7 @@ pub fn main_loop(completed: Arc<AtomicBool>) {
         panic!("Polling frequency must be a multiple of RGB refresh frequency");
     }
 
-    init_winring0();
+    winring0::init();
 
     let sleep = timer::Sleep::new();
     let settings = settings::Settings::read(consts::FILE_CONF).expect("Cannot load settings");
@@ -77,20 +77,5 @@ pub fn main_loop(completed: Arc<AtomicBool>) {
     // println!("Press any key to continue...");
     // std::io::stdin().read_line(&mut String::new()).unwrap();
 
-    unsafe {
-        winring0::DeinitializeOls();
-    }
-}
-
-fn init_winring0() {
-    unsafe {
-        let ols_ok = winring0::InitializeOls() != 0;
-        if !ols_ok {
-            panic!("Unable to initalize WingRing0");
-        }
-        let dll_status = winring0::GetDllStatus();
-        if dll_status != 0 {
-            panic!("WingRing0 DLL status error: {}", dll_status);
-        }
-    }
+    winring0::deinit();
 }