Use 64 MHz for 3.5" PiTFT

This commit is contained in:
Phillip Burgess 2016-12-05 15:32:08 -08:00
parent fd52aee625
commit 10d463b368

View file

@ -55,6 +55,7 @@ PROJ_SELECT=$?
PITFT_VALUES=(pitft22 pitft28-resistive pitft28-capacitive pitft35-resistive) PITFT_VALUES=(pitft22 pitft28-resistive pitft28-capacitive pitft35-resistive)
WIDTH_VALUES=(320 320 320 480) WIDTH_VALUES=(320 320 320 480)
HEIGHT_VALUES=(240 240 240 320) HEIGHT_VALUES=(240 240 240 320)
HZ_VALUES=(80000000 80000000 80000000 64000000)
ROTATE_VALUES=(0 90 180 270) ROTATE_VALUES=(0 90 180 270)
if [ $PROJ_SELECT -lt 2 ]; then if [ $PROJ_SELECT -lt 2 ]; then
@ -94,7 +95,7 @@ fi
# START INSTALL ------------------------------------------------------------ # START INSTALL ------------------------------------------------------------
echo echo
echo "PiTFT overlay: ${PITFT_VALUES[$PITFT_SELECT-1]}" echo "Device: ${PITFT_VALUES[$PITFT_SELECT-1]}"
echo "Rotate: ${ROTATE_VALUES[$ROTATE_SELECT-1]}" echo "Rotate: ${ROTATE_VALUES[$ROTATE_SELECT-1]}"
echo echo
echo -n "CONTINUE? [y/N] " echo -n "CONTINUE? [y/N] "
@ -119,7 +120,7 @@ reconfig() {
grep $2 $1 >/dev/null grep $2 $1 >/dev/null
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
# Pattern found; replace in file # Pattern found; replace in file
sed -i s/$2/$3/g $1 >/dev/null sed -i "s/$2/$3/g" $1 >/dev/null
else else
# Not found; append (silently) # Not found; append (silently)
echo $3 | sudo tee -a $1 >/dev/null echo $3 | sudo tee -a $1 >/dev/null
@ -160,7 +161,7 @@ echo "Configuring PiTFT..."
raspi-config nonint do_spi 0 raspi-config nonint do_spi 0
# Set up PiTFT device tree overlay # Set up PiTFT device tree overlay
reconfig /boot/config.txt "^.*dtoverlay=pitft.*$" "dtoverlay=${PITFT_VALUES[PITFT_SELECT-1]},rotate=90,speed=80000000,fps=60" reconfig /boot/config.txt "^.*dtoverlay=pitft.*$" "dtoverlay=${PITFT_VALUES[PITFT_SELECT-1]},rotate=90,speed=${HZ_VALUES[PITFT_SELECT-1]},fps=60"
# Set up framebuffer rotation # Set up framebuffer rotation
reconfig /boot/config.txt "^.*display_rotate.*$" "display_rotate=${ROTATE_VALUES[ROTATE_SELECT-1]}" reconfig /boot/config.txt "^.*display_rotate.*$" "display_rotate=${ROTATE_VALUES[ROTATE_SELECT-1]}"
@ -183,7 +184,7 @@ echo "Done."
echo echo
echo "Settings take effect on next boot." echo "Settings take effect on next boot."
echo echo
echo -n "REBOOT NOW? [y/N]" echo -n "REBOOT NOW? [y/N] "
read read
if [[ ! "$REPLY" =~ ^(yes|y|Y)$ ]]; then if [[ ! "$REPLY" =~ ^(yes|y|Y)$ ]]; then
echo "Exiting without reboot." echo "Exiting without reboot."