sumotoy / TFT_ILI9163C

A library for ILI9163C displays for Teensy, Arduino, ESP82266 and more...
169 stars 71 forks source link

Not common - but color #define conflict #46

Open Defragster opened 8 years ago

Defragster commented 8 years ago

In one sketch using Adafruit_SSD1306 with this ILI9163C code it re-defines black at 0x0, but changes WHITE from 0x1 to 0xffff - which broke my sketch using white when I moved the #define

I suppose this is why the ILI9341 uses longer #define names on colors like: ILI9341_WHITE 0xFFFF.

` In file included from C:\tCode\libraries\TFT_ILI9163C/TFT_ILI9163C.h:100:0, from C:\tCode\T3_K66\COMBO\I2C_SPI_bubb_1306_9163\I2C_SPI_bubb_1306_9163.ino:812: C:\tCode\libraries\TFT_ILI9163C/_settings/TFT_ILI9163C_colors.h:5:0: warning: "BLACK" redefined [enabled by default]

define BLACK 0x0000

^ In file included from C:\tCode\T3_K66\COMBO\I2C_SPI_bubb_1306_9163\I2C_SPI_bubb_1306_9163.ino:32:0: I:\arduino169\hardware\teensy\avr\libraries\Adafruit_SSD1306/Adafruit_SSD1306.h:50:0: note: this is the location of the previous definition

define BLACK 0

^ In file included from C:\tCode\libraries\TFT_ILI9163C/TFT_ILI9163C.h:100:0, from C:\tCode\T3_K66\COMBO\I2C_SPI_bubb_1306_9163\I2C_SPI_bubb_1306_9163.ino:812: C:\tCode\libraries\TFT_ILI9163C/_settings/TFT_ILI9163C_colors.h:6:0: warning: "WHITE" redefined [enabled by default]

define WHITE 0xFFFF

^ In file included from C:\tCode\T3_K66\COMBO\I2C_SPI_bubb_1306_9163\I2C_SPI_bubb_1306_9163.ino:32:0: I:\arduino169\hardware\teensy\avr\libraries\Adafruit_SSD1306/Adafruit_SSD1306.h:51:0: note: this is the location of the previous definition

define WHITE 1

^`

sumotoy commented 8 years ago

This is an old story, My point of view is pushing for use an 'universal' defined 16bit color names shared by all libraries (almost all uses 16 bit color definitions), but adafruit uses for SSD1306 color definitions even for a black&white device!!! To be honest, we both need to change definitions but for the adafruit_SSD1306 it's much, much easier since it don't need a definition at all! Technically it's empty pixel or filled pixel, can be substituted by a bool. I can change to use TFT_ILI9163C in front of any color definition but I really want to push to use common color definitions (as BLACK, WHITE,BLUE,ETc.) for ALL known color display (tft or oled) libraries, mine and from others, will be much easier and 99.99% compatible!