projects
/
temp2RGB.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add support for Corsair Lighting Pro
[temp2RGB.git]
/
src
/
machine.rs
diff --git
a/src/machine.rs
b/src/machine.rs
index
d1ff5c4
..
6bb3bfc
100644
(file)
--- a/
src/machine.rs
+++ b/
src/machine.rs
@@
-1,4
+1,4
@@
-use crate::{a770,
corsair_vengeance, rgb, sensors_jiji, winring0, AsusAuraUSB
};
+use crate::{a770,
asus_aura_usb, corsair_vengeance, cpu_temperature, intel_arc, rgb
};
pub trait Machine {
fn set_color(&mut self, color: &rgb::RGB);
pub trait Machine {
fn set_color(&mut self, color: &rgb::RGB);
@@
-8,9
+8,9
@@
pub trait Machine {
pub struct MachineJiji {
ram: Vec<corsair_vengeance::Controller>,
pub struct MachineJiji {
ram: Vec<corsair_vengeance::Controller>,
- b650e_device:
AsusAuraUSB
::Device,
+ b650e_device:
asus_aura_usb
::Device,
a770: a770::A770,
a770: a770::A770,
-
sensors: sensors_jiji::Sensor
s,
+
gpu_devices: intel_arc::Device
s,
}
impl MachineJiji {
}
impl MachineJiji {
@@
-21,9
+21,9
@@
impl MachineJiji {
corsair_vengeance::Controller::new(0x19),
corsair_vengeance::Controller::new(0x1B),
],
corsair_vengeance::Controller::new(0x19),
corsair_vengeance::Controller::new(0x1B),
],
- b650e_device:
AsusAuraUSB::Device::new(&api, AsusAuraUSB
::Motherboard::Asus650e),
+ b650e_device:
asus_aura_usb::Device::new(&api, asus_aura_usb
::Motherboard::Asus650e),
a770: a770::A770::new(),
a770: a770::A770::new(),
-
sensors: sensors_jiji::Sensors::new()
,
+
gpu_devices: unsafe { intel_arc::GetDevices() }
,
};
machine.b650e_device.set_fixed_mode();
machine
};
machine.b650e_device.set_fixed_mode();
machine
@@
-38,12
+38,21
@@
impl Machine for MachineJiji {
self.b650e_device.set_color(&color);
self.a770.set_color(color.red, color.green, color.blue);
}
self.b650e_device.set_color(&color);
self.a770.set_color(color.red, color.green, color.blue);
}
+
fn get_gpu_tmp(&self) -> f32 {
fn get_gpu_tmp(&self) -> f32 {
- self.sensors.read_gpu_temp()
+ unsafe { intel_arc::GetTemperature(self.gpu_devices, 0) as f32 }
}
fn get_cpu_tmp(&self) -> f32 {
}
fn get_cpu_tmp(&self) -> f32 {
- self.sensors.read_cpu_temp()
+ cpu_temperature::read()
+ }
+}
+
+impl Drop for MachineJiji {
+ fn drop(&mut self) {
+ unsafe {
+ intel_arc::FreeDevices(self.gpu_devices);
+ }
}
}
}
}