mirror of
https://codeberg.org/icewind/palantir.git
synced 2026-06-03 10:14:09 +02:00
rk3588 temperature
This commit is contained in:
parent
b0545a6d4e
commit
318af5a187
2 changed files with 14 additions and 4 deletions
|
|
@ -70,7 +70,8 @@ impl Device {
|
|||
|
||||
pub fn sensors(&self) -> impl Iterator<Item = io::Result<Sensor>> {
|
||||
// determine early to avoid borrowing &self in iterator
|
||||
let is_cpu_thermal = self.name == "cpu_thermal";
|
||||
let is_cpu_thermal = self.name == "cpu_thermal" || self.name == "soc_thermal";
|
||||
let is_gpu_thermal = self.name == "gpu_thermal";
|
||||
|
||||
let sensors = read_dir(&self.base_path).into_iter().flatten();
|
||||
sensors
|
||||
|
|
@ -91,13 +92,19 @@ impl Device {
|
|||
|
||||
let input_name = path.file_name().unwrap().to_str().unwrap();
|
||||
|
||||
// rpi cpu_thermal doesn't have labels, so we hardcode one
|
||||
// rpi/rk3588 cpu_thermal doesn't have labels, so we hardcode one
|
||||
if is_cpu_thermal && input_name == "temp1_input" {
|
||||
return Ok(Sensor {
|
||||
input_path: path,
|
||||
name: "Tdie".into(),
|
||||
});
|
||||
}
|
||||
if is_gpu_thermal && input_name == "temp1_input" {
|
||||
return Ok(Sensor {
|
||||
input_path: path,
|
||||
name: "edge".into(),
|
||||
});
|
||||
}
|
||||
|
||||
let base_name = input_name.trim_end_matches("_input");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue