@@ -87,34 +87,28 @@ if [ $scriptAction == 'INSTALL' ] ; then
8787 # install overlay only if it doesn't exist
8888 [ -f " $overlayFile " ] || logMessage " installing Display Backlight overlay" && rebootNeeded=true && updateActiveFile " $overlayFile "
8989
90- if [ $( grep -c " VeTouchDisplay" " $configFile " ) == 0 ]; then
91- logMessage " activating VeTouchDisplay settings in $configFile "
92- cp $configFile $configFile .tmp
93- # remove any previouos lines added by this script
94- sed -i -e " /#### begin VeTouchDisplay/,/#### end VeTouchDisplay/d" " $configFile .tmp"
95-
96- echo " " >> " $configFile .tmp"
97- echo " #### begin VeTouchDisplay" >> " $configFile .tmp"
98- echo " # Elecrow RC050 5 inch HDMI 800 x 480 Capacitive Touch LCD Display for Raspberry Pi/ PC/ SONY PS4" >> " $configFile .tmp"
99- echo " # https://www.elecrow.com/wiki/index.php?title=RC050_5_inch_HDMI_800_x_480_Capacitive_Touch_LCD_Display_for_Raspberry_Pi/_PC/_SONY_PS4" >> " $configFile .tmp"
100- echo " hdmi_force_hotplug=1" >> " $configFile .tmp"
101- echo " max_usb_current=1" >> " $configFile .tmp"
102- echo " hdmi_drive=1" >> " $configFile .tmp"
103- echo " hdmi_group=2" >> " $configFile .tmp"
104- echo " hdmi_mode=1" >> " $configFile .tmp"
105- echo " hdmi_mode=87" >> " $configFile .tmp"
106- echo " hdmi_cvt=800 480 60 6 0 0 0" >> " $configFile .tmp"
107- 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" >> " $configFile .tmp"
108- echo " display_rotate=$display_rotate " >> " $configFile .tmp"
109- echo " framebuffer_width=800" >> " $configFile .tmp"
110- echo " framebuffer_height=480" >> " $configFile .tmp"
111- echo " # for backlight on / off" >> " $configFile .tmp"
112- echo " # gpio-led overlay allows to invert the backlight (echo 0 for on and 1 for off, like backlight blanking)" >> " $configFile .tmp"
113- echo " dtoverlay=gpio-led,gpio=$gpioPin ,label=backlight,active_low=1" >> " $configFile .tmp"
114- echo " #### end VeTouchDisplay" >> " $configFile .tmp"
115- echo " " >> " $configFile .tmp"
116- rebootNeeded=true
117- fi
90+ logMessage " activating VeTouchDisplay settings in $configFile "
91+ cp $configFile $configFile .tmp
92+ # remove any previouos lines added by this script
93+ sed -i -e " /#### begin VeTouchDisplay/,/#### end VeTouchDisplay/d" " $configFile .tmp"
94+
95+ echo " " >> " $configFile .tmp"
96+ echo " #### begin VeTouchDisplay" >> " $configFile .tmp"
97+ echo " # Elecrow RC050 5 inch HDMI 800 x 480 Capacitive Touch LCD Display for Raspberry Pi/ PC/ SONY PS4" >> " $configFile .tmp"
98+ echo " # https://www.elecrow.com/wiki/index.php?title=RC050_5_inch_HDMI_800_x_480_Capacitive_Touch_LCD_Display_for_Raspberry_Pi/_PC/_SONY_PS4" >> " $configFile .tmp"
99+ echo " hdmi_force_hotplug=1" >> " $configFile .tmp"
100+ echo " max_usb_current=1" >> " $configFile .tmp"
101+ echo " hdmi_drive=1" >> " $configFile .tmp"
102+ echo " hdmi_group=2" >> " $configFile .tmp"
103+ echo " hdmi_mode=1" >> " $configFile .tmp"
104+ echo " hdmi_mode=87" >> " $configFile .tmp"
105+ echo " hdmi_cvt=800 480 60 6 0 0 0" >> " $configFile .tmp"
106+ echo " display_rotate=$display_rotate " >> " $configFile .tmp"
107+ echo " framebuffer_width=800" >> " $configFile .tmp"
108+ echo " framebuffer_height=480" >> " $configFile .tmp"
109+ echo " # for backlight on / off" >> " $configFile .tmp"
110+ echo " # gpio-led overlay allows to invert the backlight (echo 0 for on and 1 for off, like backlight blanking)" >> " $configFile .tmp"
111+ echo " dtoverlay=gpio-led,gpio=$gpioPin ,label=backlight,active_low=1" >> " $configFile .tmp"
118112 # comment dtoverlay=vc4-kms-v3c for raspberrypi4 if active
119113 if [ $machine == " raspberrypi4" ]; then
120114 if [ $( grep -c " ^\s*dtoverlay=vc4-kms-v3c" " $configFile " ) != 0 ]; then
@@ -123,6 +117,8 @@ if [ $scriptAction == 'INSTALL' ] ; then
123117 rebootNeeded=true
124118 fi
125119 fi
120+ echo " #### end VeTouchDisplay" >> " $configFile .tmp"
121+ echo " " >> " $configFile .tmp"
126122 # detect changes
127123 cmp -s $configFile " $configFile .tmp" > /dev/null
128124 if (( $? == 1 )) ; then
0 commit comments