From 0c50e4418792d9f5b78ef1c96d66514058beec26 Mon Sep 17 00:00:00 2001 From: Greg Burri Date: Sat, 27 Apr 2024 16:34:22 +0200 Subject: [PATCH] Remove A770 for MachineJiji --- src/machine.rs | 38 ++++++++++++++++++++++---------------- src/tests.rs | 8 ++++---- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/src/machine.rs b/src/machine.rs index 9d150db..ac60e72 100644 --- a/src/machine.rs +++ b/src/machine.rs @@ -2,7 +2,8 @@ use log::error; use nvapi::sys::i2c; use crate::{ - a770, asus_aura_usb, corsair_lighting_pro, corsair_vengeance, cpu_temperature, intel_arc, rgb, + /*a770,*/ asus_aura_usb, corsair_lighting_pro, corsair_vengeance, cpu_temperature, + intel_arc, rgb, }; const RGB_FUSION2_GPU_REG_COLOR: u8 = 0x40; @@ -19,8 +20,9 @@ pub trait Machine { pub struct MachineJiji { ram: Vec, b650e_device: asus_aura_usb::Device, - a770: a770::A770, - gpu_devices: intel_arc::Devices, + // a770: a770::A770, + // gpu_devices: intel_arc::Devices, + gpus: Vec, } impl MachineJiji { @@ -32,8 +34,9 @@ impl MachineJiji { corsair_vengeance::Controller::new(0x1B), ], b650e_device: asus_aura_usb::Device::new(&api, asus_aura_usb::Motherboard::Asus650e)?, - a770: a770::A770::new()?, - gpu_devices: unsafe { intel_arc::GetDevices() }, + // a770: a770::A770::new()?, + // gpu_devices: unsafe { intel_arc::GetDevices() }, + gpus: nvapi::PhysicalGpu::enumerate()?, }) } } @@ -44,13 +47,16 @@ impl Machine for MachineJiji { controller.set_color(&color); } self.b650e_device.set_color(&color); - if let Err(error) = self.a770.set_color(color.red, color.green, color.blue) { - error!("Unable to set color: {:?}", error); - } + // if let Err(error) = self.a770.set_color(color.red, color.green, color.blue) { + // error!("Unable to set color: {:?}", error); + // } } fn get_gpu_tmp(&self) -> f32 { - unsafe { intel_arc::GetTemperature(self.gpu_devices, 0) as f32 } + // unsafe { intel_arc::GetTemperature(self.gpu_devices, 0) as f32 } + self.gpus[0].thermal_settings(None).unwrap()[0] + .current_temperature + .0 as f32 } fn get_cpu_tmp(&self) -> f32 { @@ -58,13 +64,13 @@ impl Machine for MachineJiji { } } -impl Drop for MachineJiji { - fn drop(&mut self) { - unsafe { - intel_arc::FreeDevices(self.gpu_devices); - } - } -} +// impl Drop for MachineJiji { +// fn drop(&mut self) { +// unsafe { +// intel_arc::FreeDevices(self.gpu_devices); +// } +// } +// } pub struct MachineLyssMetal { crosshair_device: asus_aura_usb::Device, diff --git a/src/tests.rs b/src/tests.rs index 0cf81ad..f01f77a 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -12,17 +12,17 @@ pub fn tests() { winring0::init(); - // test_asus_aura_usb(asus_aura_usb::Motherboard::AsusCrosshairVIIIHero); + // test_asus_aura_usb(asus_aura_usb::Motherboard::Asus650e); // test_corsair_lighting_pro(); // list_usb_devices(); // test_roccat(); // test_wmi(); // test_corsair(); // test_a770(); - test_3080ti(); + // test_3080ti(); // test_read_temperature_cpu(); - // test_read_temperature_a770() - // test_read_temperature_3080(); + // test_read_temperature_a770(); + test_read_temperature_3080(); winring0::deinit(); -- 2.45.2