Allow generic driver to use a custom SPI port

I have a SeeedStudio Wio Terminal.
I'm using this lib in VS Code with PlatformIO but the lib
don't use the `SPICOM` variable when it's a generic device.

Steps to reproduce (using a Wio Terminal):
* Create a project using PlatformIO
* Add the TFT_eSPI lib to the project
* Add in the build flags these lines
```
build_flags = 
	-DUSER_SETUP_LOADED=1
	-DILI9341_DRIVER=1
	-DHASSPI=1
	-DSPICOM=LCD_SPI
	-DTFT_CS=LCD_SS_PIN
	-DTFT_DC=LCD_DC
	-DTFT_RST=LCD_RESET
	-DTFT_BL=LCD_BACKLIGHT
	-DTFT_BACKLIGHT_ON=HIGH
	-DTFT_BACKLINGT_V=2000
```
* Compile and transfer to the device
=> only backlight works
This commit is contained in:
Frogomeli
2022-03-04 17:31:42 +01:00
committed by GitHub
parent e83383c69a
commit 4fd8aa8bd4

View File

@@ -7,7 +7,11 @@
////////////////////////////////////////////////////////////////////////////////////////
// Select the SPI port to use
#ifndef SPICOM
SPIClass& spi = SPI;
#else
SPIClass& spi = SPICOM;
#endif
////////////////////////////////////////////////////////////////////////////////////////
#if defined (TFT_SDA_READ) && !defined (TFT_PARALLEL_8_BIT)