Hi,
I have a compilation problem with the GFX library on my code, building for ATMega4809.
I have therefore decided, to clear any own code related issue to try and build the GFX canvas example.
I’ve been through almost all the issues I have been able to read on this forum and elsewhere… the missing Adafruit_I2CDevice.h, that I’ve tried to fix with lib_ldf_mode=chain+ ( and even further with deep+ ) with no success, so I’ve added it explicitely in the main file.
It moved one step and then I had something else wrong in the Adafruit_SPIDevice.h : the BitOrder was not defined in the code.
However it is defined in that Adafruit file :
// some modern SPI definitions don’t have BitOrder enum
#if ((defined(AVR) && !defined(ARDUINO_ARCH_MEGAAVR)) ||
defined(ESP8266) || defined(TEENSYDUINO) || defined(SPARK) ||
defined(ARDUINO_ARCH_SPRESENSE) || defined(MEGATINYCORE) ||
defined(DXCORE) || defined(ARDUINO_AVR_ATmega4809) ||
defined(ARDUINO_AVR_ATmega4808) || defined(ARDUINO_AVR_ATmega3209) ||
defined(ARDUINO_AVR_ATmega3208) || defined(ARDUINO_AVR_ATmega1609) ||
defined(ARDUINO_AVR_ATmega1608) || defined(ARDUINO_AVR_ATmega809) ||
defined(ARDUINO_AVR_ATmega808))
typedef enum _BitOrder {
SPI_BITORDER_MSBFIRST = MSBFIRST,
SPI_BITORDER_LSBFIRST = LSBFIRST,
} BitOrder;
#elif (defined(ESP32) || defined(ASR6501))
// some modern SPI definitions don’t have BitOrder enum and have different SPI
// mode defines
typedef enum _BitOrder {
SPI_BITORDER_MSBFIRST = SPI_MSBFIRST,
SPI_BITORDER_LSBFIRST = SPI_LSBFIRST,
} BitOrder;#else
// Some platforms have a BitOrder enum but its named MSBFIRST/LSBFIRST
#define SPI_BITORDER_MSBFIRST MSBFIRST
#define SPI_BITORDER_LSBFIRST LSBFIRST
#endif
So I’ve pulled it out from that definition to give it a try. It passed that step to another issue.
Adafruit_GFX_Library\Adafruit_GrayOLED.cpp:143:50: error: no matching function for call to 'Adafruit_SPIDevice(int8_t&, uint32_t&, int, SPI_MODE_enum, SPIClass*&)'
it looked like neverending problem and also seemed not reasonnable to keep and edit a third party library that does work fully under different circumstances ( and Arduino IDE is one of these ).
Configuration file for ATMega4809:
[env:ATmega4809]
platform = atmelmegaavr
board = ATmega4809
framework = arduino
lib_extra_dirs = ~/Documents/Arduino/libraries
lib_ldf_mode = chain+
So I finally I’ve decided to give it a go with a different chip, a classical ATMega2560, and… guess what : it does compile with no errors,
Configuration file for ATMega2560
[env:megaatmega2560]
platform = atmelavr
board = megaatmega2560
framework = arduino
lib_extra_dirs = ~/Documents/Arduino/libraries
lib_ldf_mode = chain+
how can I check that all preprocessor variables are properly set for my cpu ( yes, it’s ATMega4809 that I’m using ) I now suspect that there are missing preprocessor directives for this CPU as it does compile with another one
Any view on this problem or what could be missing in this configuration ?