projects
/
temp2RGB.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a color (2 colors can be now defined for a machine).
[temp2RGB.git]
/
src
/
machine.rs
diff --git
a/src/machine.rs
b/src/machine.rs
index
ac60e72
..
1d7bb2e
100644
(file)
--- a/
src/machine.rs
+++ b/
src/machine.rs
@@
-3,7
+3,7
@@
use nvapi::sys::i2c;
use crate::{
/*a770,*/ asus_aura_usb, corsair_lighting_pro, corsair_vengeance, cpu_temperature,
use crate::{
/*a770,*/ asus_aura_usb, corsair_lighting_pro, corsair_vengeance, cpu_temperature,
- intel_arc, rgb,
+ intel_arc,
lian_li_sl_infinity,
rgb,
};
const RGB_FUSION2_GPU_REG_COLOR: u8 = 0x40;
};
const RGB_FUSION2_GPU_REG_COLOR: u8 = 0x40;
@@
-12,7
+12,12
@@
const RGB_FUSION2_GPU_REG_MODE: u8 = 0x88;
const GIGABYTE_RTX3080TI_VISION_OC_ADDR: u8 = 0x63;
pub trait Machine {
const GIGABYTE_RTX3080TI_VISION_OC_ADDR: u8 = 0x63;
pub trait Machine {
- fn set_color(&mut self, color: &rgb::RGB);
+ fn set_color(&mut self, color: &rgb::RGB) {
+ self.set_color_1(&color);
+ self.set_color_2(&color);
+ }
+ fn set_color_1(&mut self, color: &rgb::RGB);
+ fn set_color_2(&mut self, color: &rgb::RGB);
fn get_gpu_tmp(&self) -> f32;
fn get_cpu_tmp(&self) -> f32;
}
fn get_gpu_tmp(&self) -> f32;
fn get_cpu_tmp(&self) -> f32;
}
@@
-42,16
+47,15
@@
impl MachineJiji {
}
impl Machine for MachineJiji {
}
impl Machine for MachineJiji {
- fn set_color(&mut self, color: &rgb::RGB) {
+ fn set_color
_1
(&mut self, color: &rgb::RGB) {
for controller in &self.ram {
controller.set_color(&color);
}
for controller in &self.ram {
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);
- // }
+ self.b650e_device.set_color(&color).unwrap();
}
}
+ fn set_color_2(&mut self, color: &rgb::RGB) {} // No color 2.
+
fn get_gpu_tmp(&self) -> f32 {
// unsafe { intel_arc::GetTemperature(self.gpu_devices, 0) as f32 }
self.gpus[0].thermal_settings(None).unwrap()[0]
fn get_gpu_tmp(&self) -> f32 {
// unsafe { intel_arc::GetTemperature(self.gpu_devices, 0) as f32 }
self.gpus[0].thermal_settings(None).unwrap()[0]
@@
-75,6
+79,7
@@
impl Machine for MachineJiji {
pub struct MachineLyssMetal {
crosshair_device: asus_aura_usb::Device,
corsair_lignting_pro: corsair_lighting_pro::Device,
pub struct MachineLyssMetal {
crosshair_device: asus_aura_usb::Device,
corsair_lignting_pro: corsair_lighting_pro::Device,
+ lian_li_sl_infinity: lian_li_sl_infinity::Device,
gpus: Vec<nvapi::PhysicalGpu>,
}
gpus: Vec<nvapi::PhysicalGpu>,
}
@@
-97,6
+102,7
@@
impl MachineLyssMetal {
blue: 40,
},
),
blue: 40,
},
),
+ lian_li_sl_infinity: lian_li_sl_infinity::Device::new(&api),
gpus: nvapi::PhysicalGpu::enumerate()?,
};
gpus: nvapi::PhysicalGpu::enumerate()?,
};
@@
-158,12
+164,16
@@
impl MachineLyssMetal {
}
impl Machine for MachineLyssMetal {
}
impl Machine for MachineLyssMetal {
- fn set_color(&mut self, color: &rgb::RGB) {
- self.crosshair_device.set_color(&color);
+ fn set_color
_1
(&mut self, color: &rgb::RGB) {
+ self.crosshair_device.set_color(&color)
.unwrap()
;
self.corsair_lignting_pro.set_color(&color);
// self.set_color_3080ti(&color); // TODO.
}
self.corsair_lignting_pro.set_color(&color);
// self.set_color_3080ti(&color); // TODO.
}
+ fn set_color_2(&mut self, color: &rgb::RGB) {
+ self.lian_li_sl_infinity.set_color(&color);
+ }
+
fn get_gpu_tmp(&self) -> f32 {
self.gpus[0].thermal_settings(None).unwrap()[0]
.current_temperature
fn get_gpu_tmp(&self) -> f32 {
self.gpus[0].thermal_settings(None).unwrap()[0]
.current_temperature