added support for ADAGFX_PIN_RST != -1
@@ -122,9 +122,12 @@ extern "C" {
// ------------------------------------------------------------------------
#elif defined(DRV_DISP_ADAGFX_ILI9341_STM)
#if (ADAGFX_SPI_HW) // Use hardware SPI or software SPI (with custom pins)
- //Adafruit_ILI9341_STM m_disp = Adafruit_ILI9341_STM(ADAGFX_PIN_CS, ADAGFX_PIN_DC, ADAGFX_PIN_RST);
- // TODO: Resolve why PIN_RST=-1 doesn't give same behavior as 2-param function variant
+ //PIN_RST=-1 doesn't give same behavior as 2-param function variant, therefore use different functions
+ #if ADAGFX_PIN_RST==-1
Adafruit_ILI9341_STM m_disp = Adafruit_ILI9341_STM(ADAGFX_PIN_CS, ADAGFX_PIN_DC);
+ #else
+ Adafruit_ILI9341_STM m_disp = Adafruit_ILI9341_STM(ADAGFX_PIN_CS, ADAGFX_PIN_DC, ADAGFX_PIN_RST);
+ #endif
#else
Adafruit_ILI9341_STM m_disp = Adafruit_ILI9341_STM(ADAGFX_PIN_CS, ADAGFX_PIN_DC, ADAGFX_PIN_MOSI, ADAGFX_PIN_CLK, ADAGFX_PIN_RST, ADAGFX_PIN_MISO);
#endif
