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
fb2e669d
Commit
fb2e669d
authored
May 01, 2020
by
Bodmer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1,4,8 bpp Sprites requite different default swapBytes settings
parent
1f2d4b0a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
5 deletions
+15
-5
TFT_eSPI.cpp
TFT_eSPI.cpp
+12
-2
TFT_eSPI.h
TFT_eSPI.h
+1
-1
library.json
library.json
+1
-1
library.properties
library.properties
+1
-1
No files found.
TFT_eSPI.cpp
View file @
fb2e669d
...
...
@@ -1132,6 +1132,8 @@ void TFT_eSPI::pushImage(int32_t x, int32_t y, int32_t w, int32_t h, uint8_t *da
if
(
bpp8
)
{
bool
swap
=
_swapBytes
;
_swapBytes
=
false
;
uint8_t
blue
[]
=
{
0
,
11
,
21
,
31
};
// blue 2 to 5 bit colour lookup table
_lastColor
=
-
1
;
// Set to illegal value
...
...
@@ -1166,8 +1168,9 @@ void TFT_eSPI::pushImage(int32_t x, int32_t y, int32_t w, int32_t h, uint8_t *da
data
+=
w
;
}
_swapBytes
=
swap
;
// Restore old value
}
else
if
(
cmap
!=
nullptr
)
else
if
(
cmap
!=
nullptr
)
// Must be 4bpp
{
bool
swap
=
_swapBytes
;
_swapBytes
=
true
;
...
...
@@ -1218,8 +1221,9 @@ void TFT_eSPI::pushImage(int32_t x, int32_t y, int32_t w, int32_t h, uint8_t *da
}
_swapBytes
=
swap
;
// Restore old value
}
else
else
// Must be 1bpp
{
bool
swap
=
_swapBytes
;
_swapBytes
=
false
;
while
(
dh
--
)
{
w
=
(
w
+
7
)
&
0xFFF8
;
...
...
@@ -1246,6 +1250,7 @@ void TFT_eSPI::pushImage(int32_t x, int32_t y, int32_t w, int32_t h, uint8_t *da
dy
++
;
}
_swapBytes
=
swap
;
// Restore old value
}
inTransaction
=
false
;
...
...
@@ -1283,6 +1288,8 @@ void TFT_eSPI::pushImage(int32_t x, int32_t y, int32_t w, int32_t h, uint8_t *da
uint16_t
lineBuf
[
dw
];
if
(
bpp8
)
{
// 8 bits per pixel
bool
swap
=
_swapBytes
;
_swapBytes
=
false
;
data
+=
dx
+
dy
*
w
;
uint8_t
blue
[]
=
{
0
,
11
,
21
,
31
};
// blue 2 to 5 bit colour lookup table
...
...
@@ -1337,6 +1344,7 @@ void TFT_eSPI::pushImage(int32_t x, int32_t y, int32_t w, int32_t h, uint8_t *da
y
++
;
data
+=
w
;
}
_swapBytes
=
swap
;
// Restore old value
}
else
if
(
cmap
!=
nullptr
)
// 4bpp with color map
{
...
...
@@ -1430,6 +1438,7 @@ void TFT_eSPI::pushImage(int32_t x, int32_t y, int32_t w, int32_t h, uint8_t *da
_swapBytes
=
swap
;
// Restore old value
}
else
{
// 1 bit per pixel
bool
swap
=
_swapBytes
;
_swapBytes
=
false
;
w
=
(
w
+
7
)
&
0xFFF8
;
while
(
dh
--
)
{
int32_t
px
=
x
;
...
...
@@ -1469,6 +1478,7 @@ void TFT_eSPI::pushImage(int32_t x, int32_t y, int32_t w, int32_t h, uint8_t *da
y
++
;
dy
++
;
}
_swapBytes
=
swap
;
// Restore old value
}
inTransaction
=
false
;
...
...
TFT_eSPI.h
View file @
fb2e669d
...
...
@@ -16,7 +16,7 @@
#ifndef _TFT_eSPIH_
#define _TFT_eSPIH_
#define TFT_ESPI_VERSION "2.2.
2
"
#define TFT_ESPI_VERSION "2.2.
3
"
/***************************************************************************************
** Section 1: Load required header files
...
...
library.json
View file @
fb2e669d
{
"name"
:
"TFT_eSPI"
,
"version"
:
"2.2.
2
"
,
"version"
:
"2.2.
3
"
,
"keywords"
:
"Arduino, tft, ePaper, display, STM32, ESP8266, NodeMCU, ESP32, M5Stack, ILI9341, ST7735, ILI9163, S6D02A1, ILI9486, ST7789, RM68140"
,
"description"
:
"A TFT and ePaper SPI graphics library with optimisation for ESP8266, ESP32 and STM32"
,
"repository"
:
...
...
library.properties
View file @
fb2e669d
name
=
TFT_eSPI
version
=
2.2.
2
version
=
2.2.
3
author
=
Bodmer
maintainer
=
Bodmer
sentence
=
TFT graphics library for Arduino processors with performance optimisation for STM32, ESP8266 and ESP32
...
...
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