From 487606e533d1705c561da2920475ed0257bbfbe6 Mon Sep 17 00:00:00 2001 From: goodtft Date: Thu, 20 Nov 2025 08:16:37 +0000 Subject: [PATCH] modify 3508 and 4008 driver --- MPI3508-show | 11 +++++++++-- MPI4008-show | 13 +++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/MPI3508-show b/MPI3508-show index 7d7dc99..0a7cef0 100755 --- a/MPI3508-show +++ b/MPI3508-show @@ -42,9 +42,16 @@ sudo cp ./usr/inittab /etc/ if [[ "$deb_version" < "12.1" ]]; then sudo cp -rf ./usr/99-fbturbo.conf-HDMI /usr/share/X11/xorg.conf.d/99-fbturbo.conf fi + if [ ! -d /etc/X11/xorg.conf.d ]; then sudo mkdir /etc/X11/xorg.conf.d fi + +if [[ "$deb_version" = "13.1" ]] || [[ "$deb_version" > "13.1" ]]; then +sudo cp -rf ./usr/99-fbturbo.conf-HDMI /usr/share/X11/xorg.conf.d/99-fbturbo.~ +sudo cp -rf ./etc/.bash_profile /home/$username/ +fi + sudo cp -rf ./usr/99-calibration.conf-3508-0 /etc/X11/xorg.conf.d/99-calibration.conf sudo touch ./.have_installed echo "hdmi:resistance:3508:0:480:320" > ./.have_installed @@ -55,8 +62,8 @@ version=`uname -v` #if test "$nodeplatform" = "raspberrypi";then #echo "this is raspberrypi kernel" input_result=0 -version=${version##* } -#version=${version#*#} +version=${version##*(} +version=${version%%-*} echo $version if test $version -lt 2017;then echo "reboot" diff --git a/MPI4008-show b/MPI4008-show index 533979a..35de805 100755 --- a/MPI4008-show +++ b/MPI4008-show @@ -34,6 +34,7 @@ sudo echo "hdmi_cvt 480 800 60 6 0 0 0" >> ./boot/config.txt.bak sudo echo "dtoverlay=ads7846,cs=1,penirq=25,penirq_pull=2,speed=50000,keep_vref_on=0,swapxy=0,pmax=255,xohms=150,xmin=200,xmax=3900,ymin=200,ymax=3900" >> ./boot/config.txt.bak sudo cp -rf ./boot/config.txt.bak /boot/config.txt +if [[ "$deb_version" < "13.1" ]]; then if [ $hardware_model -eq 5 ]; then sudo sed -i "/xrandr -o/d" /etc/xdg/lxsession/LXDE-pi/autostart sudo echo "xrandr -o 1" >> /etc/xdg/lxsession/LXDE-pi/autostart @@ -49,9 +50,17 @@ sudo cp ./usr/inittab /etc/ if [[ "$deb_version" < "12.1" ]]; then sudo cp -rf ./usr/99-fbturbo.conf-HDMI /usr/share/X11/xorg.conf.d/99-fbturbo.conf fi +fi + if [ ! -d /etc/X11/xorg.conf.d ]; then sudo mkdir /etc/X11/xorg.conf.d fi + +if [[ "$deb_version" = "13.1" ]] || [[ "$deb_version" > "13.1" ]]; then +sudo cp -rf ./usr/99-fbturbo.conf-HDMI /usr/share/X11/xorg.conf.d/99-fbturbo.~ +sudo cp -rf ./etc/.bash_profile /home/$username/ +fi + sudo cp -rf ./usr/99-calibration.conf-397-270 /etc/X11/xorg.conf.d/99-calibration.conf sudo touch ./.have_installed echo "hdmi:resistance:397:270:480:800" > ./.have_installed @@ -62,8 +71,8 @@ version=`uname -v` #if test "$nodeplatform" = "raspberrypi";then #echo "this is raspberrypi kernel" input_result=0 -version=${version##* } -#version=${version#*#} +version=${version##*(} +version=${version%%-*} echo $version if test $version -lt 2017;then echo "reboot"