Hi,
I'm using arduino 1.8.19.
I have several old "arduino uno"-based projects who rely on a very old version of 'Adafruit_GFX' library, dated 2016.
I also have a few recent esp32-based projects who drive an SSD1306 oled display.
The Adafruit_SSD1306 library requires 'Adafruit_GFX' library to work.
If I leave in place the older GFX library, the esp32 project crashes while trying to initialize the SSD1306 display.
If I replace it with the latest GFX library, the esp32 project works fine.
Problem:
I can't compile the very old "arduino-uno" project with the newer GFX library because it exceeds the flash space by far.
Question:
Is there a way to leave both libraries in place and have each project select which one to use?
NOTE:
Just for the purpose of preventing automatic update from breaking compatibility with older projects, like it would have happened in this case, I manually manage some libraries, placing them into the sketchbook directory, keeping them safe from automatic updates.
Of course this does not apply to core-specific libraries.
In this specific case, the old and new GFX libraries have different folder names, like this:
old one: ./sketchbook_directory/libraries/Adafruit_GFX_old
new one: ./sketchbook_directory/libraries/Adafruit_GFX
Of course I can't leave them both in place.
When I compile an old 328 project I have to remove the 'Adafruit_GFX' folder and put in place the 'Adafruit_GFX_old' folder. Note that I don't need to rename it as it's correctly found by the linker anyway.
Vice-versa when I compile an esp32 project: I have to remove the 'Adafruit_GFX_old' folder and put in place the 'Adafruit_GFX' one.
Renaming the .h and .cpp files does not solve the problem because the GFX library is referenced by other Adafruit libraries (for example the oled SSD1306 library), so it's not just a matter of changing the #include in my project.
Is there any way to avoid having to manually swap the libraries every time I switch from a 328 project to a esp32 project?
Thanks a lot and Bes Regards
Alessandro