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
ee91f723
Commit
ee91f723
authored
Oct 06, 2020
by
Bodmer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update DMA fn clipping for viewport
parent
c0f14b2f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
Processors/TFT_eSPI_ESP32.c
Processors/TFT_eSPI_ESP32.c
+5
-5
Processors/TFT_eSPI_STM32.c
Processors/TFT_eSPI_STM32.c
+5
-5
No files found.
Processors/TFT_eSPI_ESP32.c
View file @
ee91f723
...
...
@@ -575,18 +575,18 @@ void TFT_eSPI::pushPixelsDMA(uint16_t* image, uint32_t len)
// This will clip and also swap bytes if setSwapBytes(true) was called by sketch
void
TFT_eSPI
::
pushImageDMA
(
int32_t
x
,
int32_t
y
,
int32_t
w
,
int32_t
h
,
uint16_t
*
image
,
uint16_t
*
buffer
)
{
if
((
x
>=
_
width
)
||
(
y
>=
_height
)
||
(
!
DMA_Enabled
))
return
;
if
((
x
>=
_
vpW
)
||
(
y
>=
_vpH
)
||
(
!
DMA_Enabled
))
return
;
int32_t
dx
=
0
;
int32_t
dy
=
0
;
int32_t
dw
=
w
;
int32_t
dh
=
h
;
if
(
x
<
0
)
{
dw
+=
x
;
dx
=
-
x
;
x
=
0
;
}
if
(
y
<
0
)
{
dh
+=
y
;
dy
=
-
y
;
y
=
0
;
}
if
(
x
<
_vpX
)
{
dx
=
_vpX
-
x
;
dw
-=
dx
;
x
=
_vpX
;
}
if
(
y
<
_vpY
)
{
dy
=
_vpY
-
y
;
dh
-=
dy
;
y
=
_vpY
;
}
if
((
x
+
dw
)
>
_
width
)
dw
=
_width
-
x
;
if
((
y
+
dh
)
>
_
height
)
dh
=
_height
-
y
;
if
((
x
+
dw
)
>
_
vpW
)
dw
=
_vpW
-
x
;
if
((
y
+
dh
)
>
_
vpH
)
dh
=
_vpH
-
y
;
if
(
dw
<
1
||
dh
<
1
)
return
;
...
...
Processors/TFT_eSPI_STM32.c
View file @
ee91f723
...
...
@@ -437,18 +437,18 @@ void TFT_eSPI::pushPixelsDMA(uint16_t* image, uint32_t len)
// This will clip and also swap bytes if setSwapBytes(true) was called by sketch
void
TFT_eSPI
::
pushImageDMA
(
int32_t
x
,
int32_t
y
,
int32_t
w
,
int32_t
h
,
uint16_t
*
image
,
uint16_t
*
buffer
)
{
if
((
x
>=
_
width
)
||
(
y
>=
_height
))
return
;
if
((
x
>=
_
vpW
)
||
(
y
>=
_vpH
))
return
;
int32_t
dx
=
0
;
int32_t
dy
=
0
;
int32_t
dw
=
w
;
int32_t
dh
=
h
;
if
(
x
<
0
)
{
dw
+=
x
;
dx
=
-
x
;
x
=
0
;
}
if
(
y
<
0
)
{
dh
+=
y
;
dy
=
-
y
;
y
=
0
;
}
if
(
x
<
_vpX
)
{
dx
=
_vpX
-
x
;
dw
-=
dx
;
x
=
_vpX
;
}
if
(
y
<
_vpY
)
{
dy
=
_vpY
-
y
;
dh
-=
dy
;
y
=
_vpY
;
}
if
((
x
+
dw
)
>
_
width
)
dw
=
_width
-
x
;
if
((
y
+
dh
)
>
_
height
)
dh
=
_height
-
y
;
if
((
x
+
dw
)
>
_
vpW
)
dw
=
_vpW
-
x
;
if
((
y
+
dh
)
>
_
vpH
)
dh
=
_vpH
-
y
;
if
(
dw
<
1
||
dh
<
1
)
return
;
...
...
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