Skip to content

Commit

Permalink
read pannel from /boot/board
Browse files Browse the repository at this point in the history
  • Loading branch information
Neutree committed Nov 29, 2024
1 parent fe0d6c8 commit 540e943
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
20 changes: 11 additions & 9 deletions buildroot/board/cvitek/SG200X/overlay/etc/init.d/S04backlight
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion buildroot/board/cvitek/SG200X/overlay/etc/init.d/S05tp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 540e943

Please sign in to comment.