Fix some display issues

Fix some display issues (#11358)
This commit is contained in:
Theo Arends 2021-03-17 17:26:00 +01:00
parent b427267e2b
commit 2f7eefa8f4
4 changed files with 9 additions and 11 deletions

View File

@ -410,11 +410,13 @@ const uint16_t kGpioNiceList[] PROGMEM = {
AGPIO(GPIO_SDCARD_CS), AGPIO(GPIO_SDCARD_CS),
#endif // USE_SDCARD #endif // USE_SDCARD
#endif // USE_SPI #endif // USE_SPI
AGPIO(GPIO_SSPI_MISO), // Software SPI Master Input Client Output AGPIO(GPIO_SSPI_MISO), // Software SPI Master Input Client Output
AGPIO(GPIO_SSPI_MOSI), // Software SPI Master Output Client Input AGPIO(GPIO_SSPI_MOSI), // Software SPI Master Output Client Input
AGPIO(GPIO_SSPI_SCLK), // Software SPI Serial Clock AGPIO(GPIO_SSPI_SCLK), // Software SPI Serial Clock
AGPIO(GPIO_SSPI_CS), // Software SPI Chip Select AGPIO(GPIO_SSPI_CS), // Software SPI Chip Select
AGPIO(GPIO_SSPI_DC), // Software SPI Data or Command AGPIO(GPIO_SSPI_DC), // Software SPI Data or Command
#ifdef USE_DISPLAY #ifdef USE_DISPLAY
#ifdef USE_DISPLAY_ILI9341 #ifdef USE_DISPLAY_ILI9341
AGPIO(GPIO_ILI9341_CS), AGPIO(GPIO_ILI9341_CS),
@ -422,7 +424,6 @@ const uint16_t kGpioNiceList[] PROGMEM = {
#ifdef USE_XPT2046 #ifdef USE_XPT2046
AGPIO(GPIO_XPT2046_CS), // XPT2046 SPI Chip Select AGPIO(GPIO_XPT2046_CS), // XPT2046 SPI Chip Select
#endif #endif
#endif // USE_DISPLAY_ILI9341 #endif // USE_DISPLAY_ILI9341
#ifdef USE_DISPLAY_ILI9488 #ifdef USE_DISPLAY_ILI9488
AGPIO(GPIO_ILI9488_CS), AGPIO(GPIO_ILI9488_CS),

View File

@ -1932,7 +1932,7 @@ void CmndDisplayFont(void)
void CmndDisplayILIMOde(void) void CmndDisplayILIMOde(void)
{ {
if ((XdrvMailbox.payload >= 1) && (XdrvMailbox.payload < 16)) { if ((XdrvMailbox.payload >= 1) && (XdrvMailbox.payload <= 7)) {
Settings.display_options.ilimode = XdrvMailbox.payload; Settings.display_options.ilimode = XdrvMailbox.payload;
TasmotaGlobal.restart_flag = 2; TasmotaGlobal.restart_flag = 2;
} }

View File

@ -23,6 +23,8 @@
#define XDSP_04 4 #define XDSP_04 4
enum IliModes { ILIMODE_9341 = 1, ILIMODE_9342, ILIMODE_MAX };
#include <ILI9341_2.h> #include <ILI9341_2.h>
extern uint8_t *buffer; extern uint8_t *buffer;
@ -37,13 +39,10 @@ uint8_t ili9342_ctouch_counter = 0;
uint8_t ili9342_ctouch_counter = 0; uint8_t ili9342_ctouch_counter = 0;
#endif // USE_FT5206 #endif // USE_FT5206
bool tft_init_done = false; bool tft_init_done = false;
#define ILI9341_ID 1
#define ILI9342_ID 2
//Settings.display_options.ilimode = ILI9341_ID; //Settings.display_options.ilimode = ILIMODE_9341;
/*********************************************************************************************/ /*********************************************************************************************/
@ -66,8 +65,8 @@ void ILI9341_InitDriver()
// disable screen buffer // disable screen buffer
buffer = NULL; buffer = NULL;
if (!Settings.display_options.ilimode) { if (!Settings.display_options.ilimode || (Settings.display_options.ilimode >= ILIMODE_MAX)) {
Settings.display_options.ilimode = ILI9341_ID; Settings.display_options.ilimode = ILIMODE_9341;
} }
// default colors // default colors
@ -102,7 +101,7 @@ void ILI9341_InitDriver()
renderer->setTextFont(2); renderer->setTextFont(2);
renderer->setTextSize(1); renderer->setTextSize(1);
renderer->setTextColor(ILI9341_WHITE, ILI9341_BLACK); renderer->setTextColor(ILI9341_WHITE, ILI9341_BLACK);
renderer->DrawStringAt(50, (Settings.display_height/2)-12, (Settings.display_options.ilimode & 3)==ILI9341_ID?"ILI9341 TFT!":"ILI9342 TFT!", ILI9341_WHITE, 0); renderer->DrawStringAt(50, (Settings.display_height/2)-12, (Settings.display_options.ilimode & 3)==ILIMODE_9341?"ILI9341 TFT!":"ILI9342 TFT!", ILI9341_WHITE, 0);
delay(1000); delay(1000);
#endif // SHOW_SPLASH #endif // SHOW_SPLASH

View File

@ -17,7 +17,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#if defined(USE_I2C) || defined(USE_SPI)
#ifdef USE_DISPLAY #ifdef USE_DISPLAY
#ifdef XFUNC_PTR_IN_ROM #ifdef XFUNC_PTR_IN_ROM
@ -201,4 +200,3 @@ bool XdspCall(uint8_t Function)
} }
#endif // USE_DISPLAY #endif // USE_DISPLAY
#endif // USE_I2C or USE_SPI