-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
I have a project that would benefit from using the Adafruit GFX library, but noticed that there are two included files in approx line 12 that come with the Adafruit BusIO library. This requirement is a deal breaker as it adds extra dependencies that I am not comfortable with including in my project.
When I go to Adafruit_GFX.h and remove the two offending #includes by simply wrapping them in a #ifdef, I can compile and use the GFX library without issue.
#ifdef 0
#include <Adafruit_I2CDevice.h>
#include <Adafruit_SPIDevice.h>
#endif
As such, the BusIO library is not needed by the GFX and should be removed. It is my understand that it's included as a convenience for writing drivers... but it is the driver that should be including the IO library and not the agnostic Graphics Library.
I noticed #481 is perhaps indirectly related to this issue, and perhaps others are having similar issues.
A simple fix for this would be to wrap the library includes in an #ifndef, such as:
#ifndef NOADAFRUIT_BUSIO
#include <Adafruit_I2CDevice.h>
#include <Adafruit_SPIDevice.h>
#endif
That way, the existing codebase will be unaffected, but people like me can eliminate references to code we don't need.