mirror of
https://github.com/adafruit/TFTLCD-Library.git
synced 2026-07-27 19:55:45 +00:00
Fix warnings and chip detection
This commit is contained in:
+4
-5
@@ -112,7 +112,6 @@ void Adafruit_TFTLCD::init(void) {
|
|||||||
|
|
||||||
rotation = 0;
|
rotation = 0;
|
||||||
cursor_y = cursor_x = 0;
|
cursor_y = cursor_x = 0;
|
||||||
int textsize = 1;
|
|
||||||
textcolor = 0xFFFF;
|
textcolor = 0xFFFF;
|
||||||
_width = TFTWIDTH;
|
_width = TFTWIDTH;
|
||||||
_height = TFTHEIGHT;
|
_height = TFTHEIGHT;
|
||||||
@@ -342,7 +341,6 @@ void Adafruit_TFTLCD::begin(uint16_t id) {
|
|||||||
|
|
||||||
} else if (id == 0x9341) {
|
} else if (id == 0x9341) {
|
||||||
|
|
||||||
uint16_t a, d;
|
|
||||||
driver = ID_9341;
|
driver = ID_9341;
|
||||||
CS_ACTIVE;
|
CS_ACTIVE;
|
||||||
writeRegister8(ILI9341_SOFTRESET, 0);
|
writeRegister8(ILI9341_SOFTRESET, 0);
|
||||||
@@ -885,7 +883,7 @@ void Adafruit_TFTLCD::setRotation(uint8_t x) {
|
|||||||
|
|
||||||
if (driver == ID_9341) {
|
if (driver == ID_9341) {
|
||||||
// MEME, HX8357D uses same registers as 9341 but different values
|
// MEME, HX8357D uses same registers as 9341 but different values
|
||||||
uint16_t t;
|
uint16_t t = 0;
|
||||||
|
|
||||||
switch (rotation) {
|
switch (rotation) {
|
||||||
case 2:
|
case 2:
|
||||||
@@ -909,7 +907,7 @@ void Adafruit_TFTLCD::setRotation(uint8_t x) {
|
|||||||
|
|
||||||
if (driver == ID_HX8357D) {
|
if (driver == ID_HX8357D) {
|
||||||
// MEME, HX8357D uses same registers as 9341 but different values
|
// MEME, HX8357D uses same registers as 9341 but different values
|
||||||
uint16_t t;
|
uint16_t t = 0;
|
||||||
|
|
||||||
switch (rotation) {
|
switch (rotation) {
|
||||||
case 2:
|
case 2:
|
||||||
@@ -1012,7 +1010,8 @@ uint16_t Adafruit_TFTLCD::readID(void) {
|
|||||||
|
|
||||||
// retry a bunch!
|
// retry a bunch!
|
||||||
for (int i = 0; i < 5; i++) {
|
for (int i = 0; i < 5; i++) {
|
||||||
id = readReg(0xD3);
|
id = (uint16_t)readReg(0xD3);
|
||||||
|
delayMicroseconds(50);
|
||||||
if (id == 0x9341) {
|
if (id == 0x9341) {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -359,8 +359,8 @@
|
|||||||
|
|
||||||
#define read8inline(result) \
|
#define read8inline(result) \
|
||||||
{ \
|
{ \
|
||||||
\
|
\
|
||||||
RD_ACTIVE; \
|
RD_ACTIVE; \
|
||||||
delayMicroseconds(1); \
|
delayMicroseconds(1); \
|
||||||
result = (((PIOC->PIO_PDSR & (1 << 23)) >> (23 - 7)) | \
|
result = (((PIOC->PIO_PDSR & (1 << 23)) >> (23 - 7)) | \
|
||||||
((PIOC->PIO_PDSR & (1 << 24)) >> (24 - 6)) | \
|
((PIOC->PIO_PDSR & (1 << 24)) >> (24 - 6)) | \
|
||||||
|
|||||||
Reference in New Issue
Block a user