read pannel from /boot/board

This commit is contained in:
Neucrack
2024-11-29 11:41:01 +08:00
parent fe0d6c8413
commit 540e9435a1
2 changed files with 19 additions and 10 deletions

View File

@@ -13,17 +13,19 @@ then
fi
echo 0 > $blpwm/enable
echo "10000" > ${blpwm}/period # 100KHZ
if [ -e /boot/uEnv.txt ]
panel_value=""
if [ -e /boot/board ]
then
hd22800=$(cat /boot/uEnv.txt | grep hd228001c31 | wc -l)
if [ "${hd22800}" -ne 0 ]
then
echo "2000" > ${blpwm}/duty_cycle # 20%
else
echo "9500" > ${blpwm}/duty_cycle
fi
panel_value=$(grep '^panel=' /boot/board | cut -d '=' -f 2)
elif [ -e /boot/uEnv.txt ]
then
panel_value=$(grep '^panel=' /boot/uEnv.txt | cut -d '=' -f 2)
fi
if [ "$panel_value" = "st7701_hd228001c31" ]
then
echo "2000" > ${blpwm}/duty_cycle # 20%
else
echo "9500" > ${blpwm}/duty_cycle
echo "9000" > ${blpwm}/duty_cycle
fi
echo 1 > $blpwm/enable
fi

View File

@@ -3,7 +3,14 @@
if [ "$1" = "start" ]
then
. /etc/profile
panel_value=$(grep '^panel=' /boot/uEnv.txt | cut -d '=' -f 2)
panel_value=""
if [ -e /boot/board ]
then
panel_value=$(grep '^panel=' /boot/board | cut -d '=' -f 2)
elif [ -e /boot/uEnv.txt ]
then
panel_value=$(grep '^panel=' /boot/uEnv.txt | cut -d '=' -f 2)
fi
if [ "$panel_value" = "st7701_lct024bsi20" ]
then
echo "load cst7xx touchscreen driver"