ImpulseAdventure / GUIslice

GUIslice drag & drop embedded GUI in C for touchscreen TFT on Arduino, Raspberry Pi, ARM, ESP8266 / ESP32 / M5stack using Adafruit-GFX / TFT_eSPI / UTFT / SDL
https://www.impulseadventure.com/elec/guislice-gui.html
MIT License
1.2k stars 211 forks source link

Custom configurations for different boards #465

Open al3xsh opened 2 years ago

al3xsh commented 2 years ago

Feature Request or Enhancement

I use multiple different Arduino boards with different displays and different configurations. I was wondering if it was possible to have configuration specific files with the project and keep the GUIslice library generic?

As a specific example, I am currently using an Arduino MKR WiFi 1010 with the adafruit touch screen breakout (ili9341-ft6206). To make this work correctly I have had to change the configuration file for this specific setup:

#define GSLC_USE_PROGMEM      0

and

  // For shields, the following pinouts are typically hardcoded
  #define ADAGFX_PIN_CS       7    // Display chip select
  #define ADAGFX_PIN_DC       6     // Display SPI data/command
  #define ADAGFX_PIN_RST      0     // Display Reset

However, if I use a different set up (i.e. an Arduino Uno with the shield rather than the breakout) these will change.

Another option might be to have a separate instance of the GUIslice library for each sketch (ideally under the sketch folder) - but I can't work out how to do that! A quick search suggests it isn't possible using the standard Arduino IDE (but I might be wrong!).