Skip to content

Commit

Permalink
deduplicate code to find the sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
treibholz committed Jan 17, 2025
1 parent 9f470d7 commit 754f18f
Showing 1 changed file with 2 additions and 38 deletions.
40 changes: 2 additions & 38 deletions linux/LibSensors.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,47 +226,11 @@ void LibSensors_getCPUTemperatures(CPUData* cpus, unsigned int existingCPUs, uns

if (existingCPUs == 8) {
/* Map temperature values to Snapdragon 8cx cores */
if (String_eq(chip->prefix, "cpu0_thermal")) {
data[1] = temp;
coreTempCount++;
continue;
}
if (String_eq(chip->prefix, "cpu1_thermal")) {
data[2] = temp;
coreTempCount++;
continue;
}
if (String_eq(chip->prefix, "cpu2_thermal")) {
data[3] = temp;
coreTempCount++;
continue;
}
if (String_eq(chip->prefix, "cpu3_thermal")) {
data[4] = temp;
coreTempCount++;
continue;
}
if (String_eq(chip->prefix, "cpu4_thermal")) {
data[5] = temp;
coreTempCount++;
continue;
}
if (String_eq(chip->prefix, "cpu5_thermal")) {
data[6] = temp;
if (String_startsWith(chip->prefix, "cpu") && chip->prefix[3] >= '0' && chip->prefix[3] <= '7' && String_eq(chip->prefix + 4, "_thermal")) {
data[1 + chip->prefix[3] - '0'] = temp;
coreTempCount++;
continue;
}
if (String_eq(chip->prefix, "cpu6_thermal")) {
data[7] = temp;
coreTempCount++;
continue;
}
if (String_eq(chip->prefix, "cpu7_thermal")) {
data[8] = temp;
coreTempCount++;
continue;
}

/* Map temperature values to Rockchip cores
*
* littlecore -> cores 1..4
Expand Down

0 comments on commit 754f18f

Please sign in to comment.