Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
orangepi-xunlong
GitHub Repository: orangepi-xunlong/orangepi-build
Path: blob/next/external/packages/extras-buildpkgs/htop/debian/patches/cpu-temperatute-from-hwmon.patch
8660 views
1
diff --git a/linux/Platform.c b/linux/Platform.c
2
index bde3e3b..e7e2010 100644
3
--- a/linux/Platform.c
4
+++ b/linux/Platform.c
5
@@ -175,6 +175,9 @@ int Platform_getCpuTemp() {
6
if (!fd) {
7
fd = fopen("/sys/devices/virtual/thermal/thermal_zone0/temp", "r");
8
}
9
+ if (!fd) {
10
+ fd = fopen("/sys/class/hwmon/hwmon0/temp1_input", "r");
11
+ }
12
if (fd) {
13
int n = fscanf(fd, "%d", &Temp);
14
fclose(fd);
15
16