TFT Adafruit_ILI9341 Compile issues

Hello,

First of all, I would like to introduce myself as a new user of this platform. My background is in control systems for various applications (auto, aero, industrial, medical, …). Normally, I work on the application layer developing various feedback control algorithms. However, I have also been involved in the low level when it comes to mathematically complex implementations (e.g. DSP).

Anyhow, that all aside, I am not too experienced or very good at at diagnosing compiler issues. As you will see below.

Basically, I want to compile the TFT test application. My process is to grab the example for ILI9341, add libraries and compile. In this sense, the setup is very much like an issue pointed out by another member and documented here:

However, my compile errors are different and I can’t fully understand them. So, I thought I would ask for some feedback from everyone else. Here is a screen shot of my web browser (hopefully capturing enough info to be useful)

Thanks in advance for any comments or pointers.

Michael.

The warnings you see there are not telling us anything, but if you scroll down the list you might see errors (usually in a red frame), these are the interesting ones.

Having said this we’d have to try and build the same demo to see what’s wrong - but that might take some time.
So stay tuned (as it’s past 11pm here :sleeping:)

Thanks for letting me know. I wasn’t sure how to get a decent pic of all the errors at once, but I can give you a C&P of the errors (see below). The warnings are very verbose - I apologize, but it isn’t easy to read in this font.

Thanks again and sleep well.

In file included from testgfx.cpp:18:0:
Adafruit_ILI9341/Adafruit_ILI9341.h:24:0: warning: "pgm_read_byte" redefined [enabled by default]
 #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
 ^
In file included from ../wiring/inc/spark_wiring.h:37:0,
                 from ./inc/application.h:36,
                 from testgfx.cpp:3:
../wiring/inc/spark_wiring_arduino.h:32:0: note: this is the location of the previous definition
 #define pgm_read_byte(x)  (*(x))
 ^
In file included from Adafruit_ILI9341/Adafruit_ILI9341.cpp:17:0:
Adafruit_ILI9341/Adafruit_ILI9341.h:24:0: warning: "pgm_read_byte" redefined [enabled by default]
 #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
 ^
In file included from ../wiring/inc/spark_wiring.h:37:0,
                 from ./inc/application.h:36,
                 from Adafruit_ILI9341/../Adafruit_mfGFX/Adafruit_mfGFX.h:13,
                 from Adafruit_ILI9341/Adafruit_ILI9341.h:21,
                 from Adafruit_ILI9341/Adafruit_ILI9341.cpp:17:
../wiring/inc/spark_wiring_arduino.h:32:0: note: this is the location of the previous definition
 #define pgm_read_byte(x)  (*(x))
 ^
In file included from Adafruit_ILI9341/Adafruit_ILI9341.cpp:17:0:
Adafruit_ILI9341/Adafruit_ILI9341.cpp: In member function 'void Adafruit_ILI9341::writecommand(uint8_t)':
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
Adafruit_ILI9341/Adafruit_ILI9341.h:27:53: error: 'struct GPIO_TypeDef' has no member named 'BRR'
 #define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
                                                     ^

Adafruit_ILI9341/Adafruit_ILI9341.cpp:43:2: note: in expansion of macro 'pinLO'
  pinLO(_dc);  //digitalWrite(_dc, LOW);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.h:27:53: error: 'struct GPIO_TypeDef' has no member named 'BRR'
 #define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:45:2: note: in expansion of macro 'pinLO'
  pinLO(_cs);  //digitalWrite(_cs, LOW);
  ^
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
This looks like an error in Adafruit_ILI9341 library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
Adafruit_ILI9341/Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^

Adafruit_ILI9341/Adafruit_ILI9341.cpp:47:2: note: in expansion of macro 'pinHI'
  pinHI(_cs);  //digitalWrite(_cs, HIGH);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp: In member function 'void Adafruit_ILI9341::writedata(uint8_t)':
Adafruit_ILI9341/Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:52:2: note: in expansion of macro 'pinHI'
  pinHI(_dc);  //digitalWrite(_dc, HIGH);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.h:27:53: error: 'struct GPIO_TypeDef' has no member named 'BRR'
 #define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:54:2: note: in expansion of macro 'pinLO'
  pinLO(_cs);  //digitalWrite(_cs, LOW);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:56:2: note: in expansion of macro 'pinHI'
  pinHI(_cs);  //digitalWrite(_cs, HIGH);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp: In member function 'void Adafruit_ILI9341::begin()':
Adafruit_ILI9341/Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:112:2: note: in expansion of macro 'pinHI'
  pinHI(_rst);  //digitalWrite(_rst, HIGH);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.h:27:53: error: 'struct GPIO_TypeDef' has no member named 'BRR'
 #define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:114:2: note: in expansion of macro 'pinLO'
  pinLO(_rst);  //digitalWrite(_rst, LOW);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:116:2: note: in expansion of macro 'pinHI'
  pinHI(_rst);  //digitalWrite(_rst, HIGH);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp: In member function 'void Adafruit_ILI9341::pushColor(uint16_t)':
Adafruit_ILI9341/Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:246:2: note: in expansion of macro 'pinHI'
  pinHI(_dc);  //digitalWrite(_dc, HIGH);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.h:27:53: error: 'struct GPIO_TypeDef' has no member named 'BRR'
 #define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:247:2: note: in expansion of macro 'pinLO'
  pinLO(_cs);  //digitalWrite(_cs, LOW);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:250:2: note: in expansion of macro 'pinHI'
  pinHI(_cs);  //digitalWrite(_cs, HIGH);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp: In member function 'virtual void Adafruit_ILI9341::drawPixel(int16_t, int16_t, uint16_t)':
Adafruit_ILI9341/Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:261:2: note: in expansion of macro 'pinHI'
  pinHI(_dc);  //digitalWrite(_dc, HIGH);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.h:27:53: error: 'struct GPIO_TypeDef' has no member named 'BRR'
 #define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:262:2: note: in expansion of macro 'pinLO'
  pinLO(_cs);  //digitalWrite(_cs, LOW);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:265:2: note: in expansion of macro 'pinHI'
  pinHI(_cs);  //digitalWrite(_cs, HIGH);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp: In member function 'virtual void Adafruit_ILI9341::drawFastVLine(int16_t, int16_t, int16_t, uint16_t)':
Adafruit_ILI9341/Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:284:2: note: in expansion of macro 'pinHI'
  pinHI(_dc);  //digitalWrite(_dc, HIGH);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.h:27:53: error: 'struct GPIO_TypeDef' has no member named 'BRR'
 #define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:285:2: note: in expansion of macro 'pinLO'
  pinLO(_cs);  //digitalWrite(_cs, LOW);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:292:2: note: in expansion of macro 'pinHI'
  pinHI(_cs);  //digitalWrite(_cs, HIGH);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp: In member function 'virtual void Adafruit_ILI9341::drawFastHLine(int16_t, int16_t, int16_t, uint16_t)':
Adafruit_ILI9341/Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:310:2: note: in expansion of macro 'pinHI'
  pinHI(_dc);  //digitalWrite(_dc, HIGH);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.h:27:53: error: 'struct GPIO_TypeDef' has no member named 'BRR'
 #define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:311:2: note: in expansion of macro 'pinLO'
  pinLO(_cs);  //digitalWrite(_cs, LOW);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:318:2: note: in expansion of macro 'pinHI'
  pinHI(_cs);  //digitalWrite(_cs, HIGH);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp: In member function 'virtual void Adafruit_ILI9341::fillRect(int16_t, int16_t, int16_t, int16_t, uint16_t)':
Adafruit_ILI9341/Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:346:2: note: in expansion of macro 'pinHI'
  pinHI(_dc);  //digitalWrite(_dc, HIGH);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.h:27:53: error: 'struct GPIO_TypeDef' has no member named 'BRR'
 #define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:347:2: note: in expansion of macro 'pinLO'
  pinLO(_cs);  //digitalWrite(_cs, LOW);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:356:2: note: in expansion of macro 'pinHI'
  pinHI(_cs);  //digitalWrite(_cs, HIGH);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp: In member function 'uint8_t Adafruit_ILI9341::readdata()':
Adafruit_ILI9341/Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:411:2: note: in expansion of macro 'pinHI'
  pinHI(_dc);  //digitalWrite(_dc, HIGH);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.h:27:53: error: 'struct GPIO_TypeDef' has no member named 'BRR'
 #define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:412:2: note: in expansion of macro 'pinLO'
  pinLO(_cs);  //digitalWrite(_cs, LOW);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:414:2: note: in expansion of macro 'pinHI'
  pinHI(_cs);  //digitalWrite(_cs, HIGH);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp: In member function 'uint8_t Adafruit_ILI9341::readcommand8(uint8_t)':
Adafruit_ILI9341/Adafruit_ILI9341.h:27:53: error: 'struct GPIO_TypeDef' has no member named 'BRR'
 #define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:420:2: note: in expansion of macro 'pinLO'
  pinLO(_dc);  //digitalWrite(_dc, LOW);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.h:27:53: error: 'struct GPIO_TypeDef' has no member named 'BRR'
 #define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:422:2: note: in expansion of macro 'pinLO'
  pinLO(_cs);  //digitalWrite(_cs, LOW);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:424:2: note: in expansion of macro 'pinHI'
  pinHI(_dc);  //digitalWrite(_dc, HIGH);
  ^
Adafruit_ILI9341/Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341/Adafruit_ILI9341.cpp:426:2: note: in expansion of macro 'pinHI'
  pinHI(_cs);  //digitalWrite(_cs, HIGH);
  ^
make[1]: *** [../build/target/user/platform-6Adafruit_ILI9341/Adafruit_ILI9341.o] Error 1
make: *** [user] Error 2

I see.

Copy-Paste is fine for code and/or error messages.
Just for the sake of readability you can wrap your text blocks in something like this (as I’ve done with your errors already)

 ```cpp
 // code blocks here will add code hilighting
Here you put plain text like error messages

But as for your errors there it's a pitty, but the library was contributed by a member (@mtnscott) who hasn't updated it for compatibility with the Photon, although there already is an issue filed in the repo since Aug. 2015.

Unfortunately there is no way yet to take ownership of an abandoned contributed library.

But you could use the original base library (which has since been keept up to date) of the incredible [@peekay123's github repo][1] and use this way of importing in into your project

https://docs.particle.io/guide/getting-started/build/photon/#adding-files-to-your-app

Just copy-paste the code into the respective file tabs, import `Adafruit_mfGFX` from the libraries drawer (as you did with the not working lib, which you should remove from jour project first) and remove any `#include "Adafruit_ILI9341/..."` lines and change `#include "Adafruit_mfGFX.h"` into `#include "Adafruit_mfGFX/Adafruit_mfGFX.h"`

If you get stuck, just call, we'll help.

  [1]: https://github.com/pkourany/ILI9341_SPI_LCD
1 Like

Thanks for the assistance. Thanks for the pointer about formatting. This is like Wiki. Unfortunately. The issues look similar - I feel bad bothering you with this, but really, it would take me an eon to comprehend this.

Anyhow, per your recommendation. I did as follows, please excuse my short hand:

  1. Download mtnscott / Adafruit libraries from Github
  2. Remove the original APP entirely - Basically, start from scratch
  3. Manually do the following
  4. Create example test INO file using github contents of example test file. save.
  5. Create ILI9341 H and CPP files in tab and copy contents from mtnscott’s library. Being careful to use get file names right. save.
  6. add mfgfx libraries through drawer
  7. made sure to reference mfgfx as "#include “Adafruit_mfGFX/Adafruit_mfGFX.h” in both test INO and ILI9341 H files.
  8. made sure to reference ILI H library as #include “Adafruit_mfGFX.h” in both ILI CPP and test INO file
  9. Save again
  10. Verify - Still doesn’t compile?!

I went back and repeated above exercise but also got all original libraries (for mfGFX) from github and get the same errors (didn’t make an exact diff comparison, but the look the same). Out of desperation, I tried several combinations of modifications. No luck. Anyhow, the errors are similar (at least to start as before).

In file included from Adafruit_ILI9341.cpp:17:0:
Adafruit_ILI9341.h:24:0: warning: "pgm_read_byte" redefined [enabled by default]
 #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
 ^
In file included from ../wiring/inc/spark_wiring.h:37:0,
                 from ./inc/application.h:36,
                 from Adafruit_mfGFX/Adafruit_mfGFX.h:13,
                 from Adafruit_ILI9341.h:21,
                 from Adafruit_ILI9341.cpp:17:
../wiring/inc/spark_wiring_arduino.h:32:0: note: this is the location of the previous definition
 #define pgm_read_byte(x)  (*(x))
 ^
In file included from Adafruit_ILI9341.cpp:17:0:
Adafruit_ILI9341.cpp: In member function 'void Adafruit_ILI9341::writecommand(uint8_t)':
Adafruit_ILI9341.h:27:53: error: 'struct GPIO_TypeDef' has no member named 'BRR'
 #define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
                                                     ^

Adafruit_ILI9341.cpp:43:2: note: in expansion of macro 'pinLO'
  pinLO(_dc);  //digitalWrite(_dc, LOW);
  ^
Adafruit_ILI9341.h:27:53: error: 'struct GPIO_TypeDef' has no member named 'BRR'
 #define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:45:2: note: in expansion of macro 'pinLO'
  pinLO(_cs);  //digitalWrite(_cs, LOW);
  ^
Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^

Adafruit_ILI9341.cpp:47:2: note: in expansion of macro 'pinHI'
  pinHI(_cs);  //digitalWrite(_cs, HIGH);
  ^
Adafruit_ILI9341.cpp: In member function 'void Adafruit_ILI9341::writedata(uint8_t)':
Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:52:2: note: in expansion of macro 'pinHI'
  pinHI(_dc);  //digitalWrite(_dc, HIGH);
  ^
Adafruit_ILI9341.h:27:53: error: 'struct GPIO_TypeDef' has no member named 'BRR'
 #define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:54:2: note: in expansion of macro 'pinLO'
  pinLO(_cs);  //digitalWrite(_cs, LOW);
  ^
Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:56:2: note: in expansion of macro 'pinHI'
  pinHI(_cs);  //digitalWrite(_cs, HIGH);
  ^
Adafruit_ILI9341.cpp: In member function 'void Adafruit_ILI9341::begin()':
Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:112:2: note: in expansion of macro 'pinHI'
  pinHI(_rst);  //digitalWrite(_rst, HIGH);
  ^
Adafruit_ILI9341.h:27:53: error: 'struct GPIO_TypeDef' has no member named 'BRR'
 #define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:114:2: note: in expansion of macro 'pinLO'
  pinLO(_rst);  //digitalWrite(_rst, LOW);
  ^
Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:116:2: note: in expansion of macro 'pinHI'
  pinHI(_rst);  //digitalWrite(_rst, HIGH);
  ^
Adafruit_ILI9341.cpp: In member function 'void Adafruit_ILI9341::pushColor(uint16_t)':
Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:246:2: note: in expansion of macro 'pinHI'
  pinHI(_dc);  //digitalWrite(_dc, HIGH);
  ^
Adafruit_ILI9341.h:27:53: error: 'struct GPIO_TypeDef' has no member named 'BRR'
 #define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:247:2: note: in expansion of macro 'pinLO'
  pinLO(_cs);  //digitalWrite(_cs, LOW);
  ^
Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:250:2: note: in expansion of macro 'pinHI'
  pinHI(_cs);  //digitalWrite(_cs, HIGH);
  ^
Adafruit_ILI9341.cpp: In member function 'virtual void Adafruit_ILI9341::drawPixel(int16_t, int16_t, uint16_t)':
Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:261:2: note: in expansion of macro 'pinHI'
  pinHI(_dc);  //digitalWrite(_dc, HIGH);
  ^
Adafruit_ILI9341.h:27:53: error: 'struct GPIO_TypeDef' has no member named 'BRR'
 #define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:262:2: note: in expansion of macro 'pinLO'
  pinLO(_cs);  //digitalWrite(_cs, LOW);
  ^
Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:265:2: note: in expansion of macro 'pinHI'
  pinHI(_cs);  //digitalWrite(_cs, HIGH);
  ^
Adafruit_ILI9341.cpp: In member function 'virtual void Adafruit_ILI9341::drawFastVLine(int16_t, int16_t, int16_t, uint16_t)':
Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:284:2: note: in expansion of macro 'pinHI'
  pinHI(_dc);  //digitalWrite(_dc, HIGH);
  ^
Adafruit_ILI9341.h:27:53: error: 'struct GPIO_TypeDef' has no member named 'BRR'
 #define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:285:2: note: in expansion of macro 'pinLO'
  pinLO(_cs);  //digitalWrite(_cs, LOW);
  ^
Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:292:2: note: in expansion of macro 'pinHI'
  pinHI(_cs);  //digitalWrite(_cs, HIGH);
  ^
Adafruit_ILI9341.cpp: In member function 'virtual void Adafruit_ILI9341::drawFastHLine(int16_t, int16_t, int16_t, uint16_t)':
Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:310:2: note: in expansion of macro 'pinHI'
  pinHI(_dc);  //digitalWrite(_dc, HIGH);
  ^
Adafruit_ILI9341.h:27:53: error: 'struct GPIO_TypeDef' has no member named 'BRR'
 #define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:311:2: note: in expansion of macro 'pinLO'
  pinLO(_cs);  //digitalWrite(_cs, LOW);
  ^
Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:318:2: note: in expansion of macro 'pinHI'
  pinHI(_cs);  //digitalWrite(_cs, HIGH);
  ^
Adafruit_ILI9341.cpp: In member function 'virtual void Adafruit_ILI9341::fillRect(int16_t, int16_t, int16_t, int16_t, uint16_t)':
Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:346:2: note: in expansion of macro 'pinHI'
  pinHI(_dc);  //digitalWrite(_dc, HIGH);
  ^
Adafruit_ILI9341.h:27:53: error: 'struct GPIO_TypeDef' has no member named 'BRR'
 #define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:347:2: note: in expansion of macro 'pinLO'
  pinLO(_cs);  //digitalWrite(_cs, LOW);
  ^
Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:356:2: note: in expansion of macro 'pinHI'
  pinHI(_cs);  //digitalWrite(_cs, HIGH);
  ^
Adafruit_ILI9341.cpp: In member function 'uint8_t Adafruit_ILI9341::readdata()':
Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:411:2: note: in expansion of macro 'pinHI'
  pinHI(_dc);  //digitalWrite(_dc, HIGH);
  ^
Adafruit_ILI9341.h:27:53: error: 'struct GPIO_TypeDef' has no member named 'BRR'
 #define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:412:2: note: in expansion of macro 'pinLO'
  pinLO(_cs);  //digitalWrite(_cs, LOW);
  ^
Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:414:2: note: in expansion of macro 'pinHI'
  pinHI(_cs);  //digitalWrite(_cs, HIGH);
  ^
Adafruit_ILI9341.cpp: In member function 'uint8_t Adafruit_ILI9341::readcommand8(uint8_t)':
Adafruit_ILI9341.h:27:53: error: 'struct GPIO_TypeDef' has no member named 'BRR'
 #define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:420:2: note: in expansion of macro 'pinLO'
  pinLO(_dc);  //digitalWrite(_dc, LOW);
  ^
Adafruit_ILI9341.h:27:53: error: 'struct GPIO_TypeDef' has no member named 'BRR'
 #define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:422:2: note: in expansion of macro 'pinLO'
  pinLO(_cs);  //digitalWrite(_cs, LOW);
  ^
Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:424:2: note: in expansion of macro 'pinHI'
  pinHI(_dc);  //digitalWrite(_dc, HIGH);
  ^
Adafruit_ILI9341.h:28:53: error: 'struct GPIO_TypeDef' has no member named 'BSRR'
 #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
                                                     ^
Adafruit_ILI9341.cpp:426:2: note: in expansion of macro 'pinHI'
  pinHI(_cs);  //digitalWrite(_cs, HIGH);
  ^
make[1]: *** [../build/target/user/platform-6Adafruit_ILI9341.o] Error 1
make: *** [user] Error 2
Error: Could not compile. Please review your code.

Yup, this was the reason why I suggested to just use this library instead.
https://github.com/pkourany/ILI9341_SPI_LCD

You could use the sample from mtnscott but Paul’s .h and .cpp
Since the meanwhile not working one is based on the still working one you’d not need to change anything but the includes.

1 Like

OK. It compiles. That was very simple once I had the correct library.

Thanks for your assistance.

2 Likes