Skip to content

Commit

Permalink
Merge pull request #48 from makermelissa/master
Browse files Browse the repository at this point in the history
Fix warnings and chip detection
  • Loading branch information
makermelissa authored Jul 27, 2020
2 parents 9b701b6 + ebc64f2 commit aad1e5e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions Adafruit_TFTLCD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ void Adafruit_TFTLCD::init(void) {

rotation = 0;
cursor_y = cursor_x = 0;
int textsize = 1;
textcolor = 0xFFFF;
_width = TFTWIDTH;
_height = TFTHEIGHT;
Expand Down Expand Up @@ -342,7 +341,6 @@ void Adafruit_TFTLCD::begin(uint16_t id) {

} else if (id == 0x9341) {

uint16_t a, d;
driver = ID_9341;
CS_ACTIVE;
writeRegister8(ILI9341_SOFTRESET, 0);
Expand Down Expand Up @@ -885,7 +883,7 @@ void Adafruit_TFTLCD::setRotation(uint8_t x) {

if (driver == ID_9341) {
// MEME, HX8357D uses same registers as 9341 but different values
uint16_t t;
uint16_t t = 0;

switch (rotation) {
case 2:
Expand All @@ -909,7 +907,7 @@ void Adafruit_TFTLCD::setRotation(uint8_t x) {

if (driver == ID_HX8357D) {
// MEME, HX8357D uses same registers as 9341 but different values
uint16_t t;
uint16_t t = 0;

switch (rotation) {
case 2:
Expand Down Expand Up @@ -1012,7 +1010,8 @@ uint16_t Adafruit_TFTLCD::readID(void) {

// retry a bunch!
for (int i = 0; i < 5; i++) {
id = readReg(0xD3);
id = (uint16_t)readReg(0xD3);
delayMicroseconds(50);
if (id == 0x9341) {
return id;
}
Expand Down
4 changes: 2 additions & 2 deletions pin_magic.h
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@

#define read8inline(result) \
{ \
\
RD_ACTIVE; \
\
RD_ACTIVE; \
delayMicroseconds(1); \
result = (((PIOC->PIO_PDSR & (1 << 23)) >> (23 - 7)) | \
((PIOC->PIO_PDSR & (1 << 24)) >> (24 - 6)) | \
Expand Down

0 comments on commit aad1e5e

Please sign in to comment.