autocore-arm: add mt76 temperature for hiwifi c526a

Ref: c7f82146ef
This commit is contained in:
AmadeusGhost 2021-04-17 11:02:01 +08:00
parent d2f3889c61
commit d3e5668943
2 changed files with 7 additions and 2 deletions

View File

@ -12,7 +12,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=autocore
PKG_VERSION:=1
PKG_RELEASE:=39
PKG_RELEASE:=40
include $(INCLUDE_DIR)/package.mk

View File

@ -1,9 +1,14 @@
#!/bin/sh
mt76_path="/sys/kernel/debug/ieee80211/phy0/mt76/temperature"
if [ -e "${mt76_path}" ]; then
mt76_temp=" $(cat "${mt76_path}" | awk -F ': ' '{print $2}')°C"
fi
sys_temp="$(sensors | grep -Eo '\+[0-9]+.+C' | grep -Ev 'high' | sed ':a;N;$!ba;s/\n/ /g;s/+//g')"
if grep -q "ipq40xx" "/etc/openwrt_release"; then
echo -n "WiFi: ${sys_temp}"
echo -n "WiFi:${mt76_temp} ${sys_temp}"
else
cpu_temp="$(awk "BEGIN{printf (\"%.1f\n\",$(cat /sys/class/thermal/thermal_zone0/temp)/1000) }")°C"
echo -n "CPU: ${cpu_temp}, WiFi: ${sys_temp}"