Browse Source

Fixes Capacitive screen rotation in buster

Melissa LeBlanc-Williams 2 months ago
parent
commit
9af17f1d2b
1 changed files with 7 additions and 1 deletions
  1. 7
    1
      adafruit-pitft.sh

+ 7
- 1
adafruit-pitft.sh View File

@@ -47,6 +47,11 @@ TRANSFORM_28c90="0 1 0 -1 0 1 0 0 1"
47 47
 TRANSFORM_28c180="1 0 0 0 1 0 0 0 1"
48 48
 TRANSFORM_28c270="0 -1 1 1 0 0 0 0 1"
49 49
 
50
+ROTATE_28c0="rotate=0,touch-invx=true,touch-invy=true"
51
+ROTATE_28c90="rotate=90,touch-swapxy=true,touch-invx=true"
52
+ROTATE_28c180="rotate=180"
53
+ROTATE_28c270="rotate=270,touch-swapxy=true,touch-invy=true"
54
+
50 55
 MADCTL_st7789_240x2400="0x36,0x60,-1,0x37,0x00,0x00,-1"
51 56
 MADCTL_st7789_240x24090="0x36,0x00,-1,0x37,0x00,0x00,-1"
52 57
 MADCTL_st7789_240x240180="0x36,0xA0,-1,0x37,0x00,0x50,-1"
@@ -224,7 +229,8 @@ function update_configtxt() {
224 229
     fi
225 230
 
226 231
     if [ "${pitfttype}" == "28c" ]; then
227
-        overlay="dtoverlay=pitft28-capacitive,rotate=${pitftrot},speed=64000000,fps=30"
232
+        rotateparams=$(eval echo "\$ROTATE_$pitfttype$pitftrot")
233
+        overlay=$(printf "dtoverlay=pitft28-capacitive,speed=64000000,fps=30\ndtoverlay=pitft28-capacitive,${rotateparams}")
228 234
     fi
229 235
 
230 236
     if [ "${pitfttype}" == "35r" ]; then

Loading…
Cancel
Save