adafruit / Adafruit_RA8875

Adafruit Arduino library driver for the RA8875 TFT driver
http://www.adafruit.com/products/1590
Other
68 stars 58 forks source link

Don't init with invalid mode & fix compiler warnings #10

Closed PaulStoffregen closed 7 years ago

PaulStoffregen commented 7 years ago

This is a very minor fix for compiler warnings.

Only two resolutions are supported, 480x272 and 800x480. As currently structured, if the user gives begin() a number other than these 2 legal value, this library can do wrong things. This change checks for a wrong value and returns with false.

A couple other resolution checks are changed if/else, which makes the compiler much happier if warnings are enabled.

I tested on a Teensy 3.2 with the Adafruit RA8875 breakout and a 800x480 display.

ladyada commented 7 years ago

ok!