如何知道 CubieTruck CPU 温度

1.modprobe sunxi-dbgreg

2.

#! /bin/sh

echo ‘f1c25000:27003f’ > /sys/devices/virtual/misc/sunxi-dbgreg/rw/write;
echo ‘f1c25010:40000’ > /sys/devices/virtual/misc/sunxi-dbgreg/rw/write;
echo ‘f1c25018:10fff’ > /sys/devices/virtual/misc/sunxi-dbgreg/rw/write;
echo ‘f1c25004:10’ > /sys/devices/virtual/misc/sunxi-dbgreg/rw/write;
echo ‘f1c25020’ > /sys/devices/virtual/misc/sunxi-dbgreg/rw/read;

output=$(tail -n 1 /var/log/syslog | awk ‘{print $7}’)
degree=$(((output-1447)/10))
point=$(((output-1447)%10))
printf “Your CubieTruck’s CPU current temperature is ‘\033[31m%d.%d\033[0m’ degree Celsius.\n" $degree $point

image