Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
TFT_eSPI
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
TFT_eSPI
Commits
02a902f6
Unverified
Commit
02a902f6
authored
Feb 24, 2018
by
Bodmer
Committed by
GitHub
Feb 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Potential fix for issue #96
parent
3d993afe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
TFT_eSPI.cpp
TFT_eSPI.cpp
+6
-6
No files found.
TFT_eSPI.cpp
View file @
02a902f6
...
...
@@ -4377,7 +4377,7 @@ void TFT_eSPI::calibrateTouch(uint16_t *parameters, uint32_t color_fg, uint32_t
for
(
uint8_t
j
=
0
;
j
<
8
;
j
++
){
// Use a lower detect threshold as corners tend to be less sensitive
while
(
!
validTouch
(
&
x_tmp
,
&
y_tmp
,
Z_THRESHOLD
/
2
))
delay
(
10
);
while
(
!
validTouch
(
&
x_tmp
,
&
y_tmp
,
Z_THRESHOLD
/
4
)
);
values
[
i
*
2
]
+=
x_tmp
;
values
[
i
*
2
+
1
]
+=
y_tmp
;
}
...
...
@@ -4389,14 +4389,14 @@ void TFT_eSPI::calibrateTouch(uint16_t *parameters, uint32_t color_fg, uint32_t
// check orientation
// from case 0 to case 1, the y value changed.
// If the meas
s
ured delta of the touch x axis is bigger than the delta of the y axis, the touch and TFT axes are switched.
// If the measured delta of the touch x axis is bigger than the delta of the y axis, the touch and TFT axes are switched.
touchCalibration_rotate
=
false
;
if
(
abs
(
values
[
0
]
-
values
[
2
])
>
abs
(
values
[
1
]
-
values
[
3
])){
touchCalibration_rotate
=
true
;
touchCalibration_x
1
=
(
values
[
0
]
+
values
[
4
])
/
2
;
// calc min x
touchCalibration_x
0
=
(
values
[
2
]
+
values
[
6
])
/
2
;
// calc max x
touchCalibration_y
1
=
(
values
[
1
]
+
values
[
3
])
/
2
;
// calc min y
touchCalibration_y
0
=
(
values
[
5
]
+
values
[
7
])
/
2
;
// calc max y
touchCalibration_x
0
=
(
values
[
0
]
+
values
[
4
])
/
2
;
// calc min x
touchCalibration_x
1
=
(
values
[
2
]
+
values
[
6
])
/
2
;
// calc max x
touchCalibration_y
0
=
(
values
[
1
]
+
values
[
3
])
/
2
;
// calc min y
touchCalibration_y
1
=
(
values
[
5
]
+
values
[
7
])
/
2
;
// calc max y
}
else
{
touchCalibration_x0
=
(
values
[
0
]
+
values
[
2
])
/
2
;
// calc min x
touchCalibration_x1
=
(
values
[
4
]
+
values
[
6
])
/
2
;
// calc max x
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment