MCUdude / MegaCoreX

An Arduino hardware package for ATmega4809, ATmega4808, ATmega3209, ATmega3208, ATmega1609, ATmega1608, ATmega809 and ATmega808
GNU Lesser General Public License v2.1
245 stars 49 forks source link

Error: 'BitOrder' has not been declared, does not name a type Compiling st77** lib example. #81

Closed wa2mze closed 4 years ago

wa2mze commented 4 years ago

I tried compiling the Example 'graphicstest' for the Adafruit ST77** TFT LCD driver and got several errors concerning 'BitOrder' not being declared, (BitOrder dataorder = SPI_BITORDER_MSBFIRST) BitOrder _dataOrder;

I used the atmega4809, 48 pin package as board type. Strangely enough, selecting the Arduino Nano Every as the board type DOES compile without error, and they both use the same CPU. This might be an issue with the ADAfruit library, but I can't find the definition for 'BitOrder' in the code.

MCUdude commented 4 years ago

I tried to install the Adafruit ST7735/ST7789 library from the library manager, and I'm not able to make it build for any AVR platform. Can you post your full error message?

EDIT: I can't find any references to SPI_BITORDER_MSBFIRST in the library source files. What libraries exactly did you install?

MCUdude commented 4 years ago

I found a reference to SPI_BITORDER_MSBFIRST in the Adafruit Bus IO library.

try adding

typedef enum _BitOrder {
  SPI_BITORDER_MSBFIRST = MSBFIRST,
  SPI_BITORDER_LSBFIRST = LSBFIRST,
} BitOrder;

at the very top of your sketch, before all the #includes

MCUdude commented 4 years ago

This has been fixed in the Adafruit BusIO library.

https://github.com/adafruit/Adafruit_BusIO/pull/32