add rotation support, 2.8" etc display rotate touchscreen
This commit is contained in:
parent
d69eda94a2
commit
1ad86c65df
1 changed files with 34 additions and 5 deletions
|
|
@ -155,19 +155,19 @@ function update_configtxt() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${pitfttype}" == "22" ]; then
|
if [ "${pitfttype}" == "22" ]; then
|
||||||
overlay="dtoverlay=pitft22,rotate=270,speed=64000000,fps=30"
|
overlay="dtoverlay=pitft22,rotate=${pitftrot},speed=64000000,fps=30"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${pitfttype}" == "28r" ]; then
|
if [ "${pitfttype}" == "28r" ]; then
|
||||||
overlay="dtoverlay=pitft28-resistive,rotate=90,speed=64000000,fps=30"
|
overlay="dtoverlay=pitft28-resistive,rotate=${pitftrot},speed=64000000,fps=30"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${pitfttype}" == "28c" ]; then
|
if [ "${pitfttype}" == "28c" ]; then
|
||||||
overlay="dtoverlay=pitft28-capacitive,rotate=90,speed=64000000,fps=30"
|
overlay="dtoverlay=pitft28-capacitive,rotate=${pitftrot},speed=64000000,fps=30"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${pitfttype}" == "35r" ]; then
|
if [ "${pitfttype}" == "35r" ]; then
|
||||||
overlay="dtoverlay=pitft35-resistive,rotate=270,speed=32000000,fps=20"
|
overlay="dtoverlay=pitft35-resistive,rotate=${pitftrot},speed=32000000,fps=20"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -208,10 +208,27 @@ EOF
|
||||||
# currently for '90' rotation only
|
# currently for '90' rotation only
|
||||||
function update_pointercal() {
|
function update_pointercal() {
|
||||||
if [ "${pitfttype}" == "28r" ]; then
|
if [ "${pitfttype}" == "28r" ]; then
|
||||||
|
if [ "${pitftrot}" == "90" ]; then
|
||||||
cat > /etc/pointercal <<EOF
|
cat > /etc/pointercal <<EOF
|
||||||
33 -5782 21364572 4221 35 -1006432 65536
|
33 -5782 21364572 4221 35 -1006432 65536
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
if [ "${pitftrot}" == "180" ]; then
|
||||||
|
cat > /etc/pointercal <<EOF
|
||||||
|
-4273 61 16441290 4 -5772 21627524 65536
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
if [ "${pitftrot}" == "270" ]; then
|
||||||
|
cat > /etc/pointercal <<EOF
|
||||||
|
-9 5786 -784608 -4302 19 16620508 65536
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
if [ "${pitftrot}" == "0" ]; then
|
||||||
|
cat > /etc/pointercal <<EOF
|
||||||
|
4232 11 -879396 1 5786 -752768 65536
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${pitfttype}" == "35r" ]; then
|
if [ "${pitfttype}" == "35r" ]; then
|
||||||
cat > /etc/pointercal <<EOF
|
cat > /etc/pointercal <<EOF
|
||||||
|
|
@ -408,6 +425,17 @@ if [ $PITFT_SELECT -gt 4 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Select rotation:"
|
||||||
|
selectN "90 degrees (landscape)" \
|
||||||
|
"180 degrees (portait)" \
|
||||||
|
"270 degrees (landscape)" \
|
||||||
|
"0 degrees (portait)"
|
||||||
|
PITFT_ROTATE=$?
|
||||||
|
if [ $PITFT_ROTATE -gt 4 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
PITFT_ROTATIONS=("90" "180" "270" "0")
|
||||||
PITFT_TYPES=("28r" "22" "28c" "35r")
|
PITFT_TYPES=("28r" "22" "28c" "35r")
|
||||||
WIDTH_VALUES=(320 320 320 480)
|
WIDTH_VALUES=(320 320 320 480)
|
||||||
HEIGHT_VALUES=(240 240 240 320)
|
HEIGHT_VALUES=(240 240 240 320)
|
||||||
|
|
@ -466,6 +494,7 @@ if [[ ! -e "$target_homedir" || ! -d "$target_homedir" ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pitfttype=${PITFT_TYPES[$PITFT_SELECT-1]}
|
pitfttype=${PITFT_TYPES[$PITFT_SELECT-1]}
|
||||||
|
pitftrot=${PITFT_ROTATIONS[$PITFT_ROTATE-1]}
|
||||||
|
|
||||||
|
|
||||||
if [ "${pitfttype}" != "28r" ] && [ "${pitfttype}" != "28c" ] && [ "${pitfttype}" != "35r" ] && [ "${pitfttype}" != "22" ]; then
|
if [ "${pitfttype}" != "28r" ] && [ "${pitfttype}" != "28c" ] && [ "${pitfttype}" != "35r" ] && [ "${pitfttype}" != "22" ]; then
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue