mirror of
https://github.com/Bodmer/TFT_eSPI.git
synced 2024-09-21 10:27:11 +00:00
Fix TFT_eSprite crash and improve menu
This commit is contained in:
parent
1ab684e40d
commit
c016ea65f0
@ -2,5 +2,3 @@
|
|||||||
idf_component_register(SRCS "TFT_eSPI.cpp"
|
idf_component_register(SRCS "TFT_eSPI.cpp"
|
||||||
INCLUDE_DIRS "."
|
INCLUDE_DIRS "."
|
||||||
PRIV_REQUIRES arduino)
|
PRIV_REQUIRES arduino)
|
||||||
|
|
||||||
add_definitions(-DTFT_eSPI_COMPONENT)
|
|
25
Kconfig
25
Kconfig
@ -1,5 +1,13 @@
|
|||||||
menu "TFT_eSPI"
|
menu "TFT_eSPI"
|
||||||
|
|
||||||
|
menu "Hidden menu"
|
||||||
|
visible if false
|
||||||
|
|
||||||
|
config TFT_eSPI_ESPIDF
|
||||||
|
bool "Enable Configuration"
|
||||||
|
default y
|
||||||
|
endmenu
|
||||||
|
|
||||||
choice TFT_DRIVER
|
choice TFT_DRIVER
|
||||||
prompt "Select TFT driver"
|
prompt "Select TFT driver"
|
||||||
default TFT_ILI9341_DRIVER
|
default TFT_ILI9341_DRIVER
|
||||||
@ -149,7 +157,7 @@ menu "TFT_eSPI"
|
|||||||
Use 8-bit parallel bus to send data to the LCD. If not set SPI will be used.
|
Use 8-bit parallel bus to send data to the LCD. If not set SPI will be used.
|
||||||
|
|
||||||
menu "Display Data pins"
|
menu "Display Data pins"
|
||||||
visible if TFT_PARALLEL_8_BIT
|
depends on TFT_PARALLEL_8_BIT
|
||||||
config TFT_D0
|
config TFT_D0
|
||||||
int "Data 0 pin"
|
int "Data 0 pin"
|
||||||
default -1
|
default -1
|
||||||
@ -202,7 +210,7 @@ menu "TFT_eSPI"
|
|||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
menu "Display SPI config"
|
menu "Display SPI config"
|
||||||
visible if !TFT_PARALLEL_8_BIT
|
depends on !TFT_PARALLEL_8_BIT
|
||||||
config TFT_MISO
|
config TFT_MISO
|
||||||
int "TFT MISO pin"
|
int "TFT MISO pin"
|
||||||
default -1
|
default -1
|
||||||
@ -272,15 +280,18 @@ menu "TFT_eSPI"
|
|||||||
default -1
|
default -1
|
||||||
range -1 33
|
range -1 33
|
||||||
|
|
||||||
|
config ENABLE_BL
|
||||||
|
bool "Enable backlight control"
|
||||||
|
default y
|
||||||
|
|
||||||
|
if ENABLE_BL
|
||||||
config TFT_BL
|
config TFT_BL
|
||||||
int "TFT Backlight pin"
|
int "TFT Backlight pin"
|
||||||
default -1
|
default -1
|
||||||
range -1 33
|
range -1 33
|
||||||
help
|
help
|
||||||
Pin for the backlight control signal
|
Pin for the backlight control signal
|
||||||
Set to -1 to disable
|
|
||||||
|
|
||||||
if TFT_BL >= 0
|
|
||||||
choice TFT_BACKLIGHT_ON
|
choice TFT_BACKLIGHT_ON
|
||||||
bool "Pin state to activate backlight"
|
bool "Pin state to activate backlight"
|
||||||
default TFT_BACKLIGHT_ON_HIGH
|
default TFT_BACKLIGHT_ON_HIGH
|
||||||
@ -336,6 +347,11 @@ menu "TFT_eSPI"
|
|||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
menu "Touch screen configuration"
|
menu "Touch screen configuration"
|
||||||
|
config ENABLE_TOUCH
|
||||||
|
bool "Enable Touch"
|
||||||
|
default n
|
||||||
|
|
||||||
|
if ENABLE_TOUCH
|
||||||
config TOUCH_CS
|
config TOUCH_CS
|
||||||
int "Touch chip select pin"
|
int "Touch chip select pin"
|
||||||
default -1
|
default -1
|
||||||
@ -345,6 +361,7 @@ menu "TFT_eSPI"
|
|||||||
int "SPI frequency for XPT2046 chip (Hz)"
|
int "SPI frequency for XPT2046 chip (Hz)"
|
||||||
default 2500000
|
default 2500000
|
||||||
range 1 80000000
|
range 1 80000000
|
||||||
|
endif
|
||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
18
TFT_config.h
18
TFT_config.h
@ -1,9 +1,9 @@
|
|||||||
/**
|
/**
|
||||||
* @file utility.h
|
* @file TFT_config.h
|
||||||
* @author Ricard Bitriá Ribes (https://github.com/dracir9)
|
* @author Ricard Bitriá Ribes (https://github.com/dracir9)
|
||||||
* Created Date: 22-01-2022
|
* Created Date: 22-01-2022
|
||||||
* -----
|
* -----
|
||||||
* Last Modified: 11-04-2022
|
* Last Modified: 14-04-2022
|
||||||
* Modified By: Ricard Bitriá Ribes
|
* Modified By: Ricard Bitriá Ribes
|
||||||
* -----
|
* -----
|
||||||
* @copyright (c) 2022 Ricard Bitriá Ribes
|
* @copyright (c) 2022 Ricard Bitriá Ribes
|
||||||
@ -134,8 +134,13 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Backlight config
|
// Backlight config
|
||||||
#if CONFIG_TFT_BL != -1
|
#ifdef CONFIG_ENABLE_BL
|
||||||
|
#if CONFIG_TFT_BL == -1
|
||||||
|
#error "Invalid backlight control pin. Check TFT_eSPI configuration"
|
||||||
|
#else
|
||||||
#define TFT_BL CONFIG_TFT_BL
|
#define TFT_BL CONFIG_TFT_BL
|
||||||
|
#endif
|
||||||
|
|
||||||
#define TFT_BACKLIGHT_ON CONFIG_TFT_BACKLIGHT_ON
|
#define TFT_BACKLIGHT_ON CONFIG_TFT_BACKLIGHT_ON
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -209,7 +214,6 @@
|
|||||||
|
|
||||||
// SPI BUS
|
// SPI BUS
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#if CONFIG_TFT_MISO == -1
|
#if CONFIG_TFT_MISO == -1
|
||||||
#error "Invalid MISO pin. Check TFT_eSPI configuration"
|
#error "Invalid MISO pin. Check TFT_eSPI configuration"
|
||||||
#else
|
#else
|
||||||
@ -280,8 +284,14 @@
|
|||||||
** Section 5: Touchscreen configuration
|
** Section 5: Touchscreen configuration
|
||||||
***************************************************************************************/
|
***************************************************************************************/
|
||||||
|
|
||||||
|
#ifdef CONFIG_ENABLE_TOUCH
|
||||||
|
#if CONFIG_TOUCH_CS == -1
|
||||||
|
#error "Invalid Touch Chip Select pin. Check TFT_eSPI configuration"
|
||||||
|
#else
|
||||||
#define TOUCH_CS CONFIG_TOUCH_CS
|
#define TOUCH_CS CONFIG_TOUCH_CS
|
||||||
|
#endif
|
||||||
|
|
||||||
#define SPI_TOUCH_FREQUENCY CONFIG_SPI_TOUCH_FREQUENCY
|
#define SPI_TOUCH_FREQUENCY CONFIG_SPI_TOUCH_FREQUENCY
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // TFT_CONFIG_H
|
#endif // TFT_CONFIG_H
|
||||||
|
@ -27,10 +27,6 @@
|
|||||||
***************************************************************************************/
|
***************************************************************************************/
|
||||||
|
|
||||||
//Standard support
|
//Standard support
|
||||||
#ifdef TFT_eSPI_COMPONENT
|
|
||||||
#include "TFT_config.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <Print.h>
|
#include <Print.h>
|
||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
@ -40,6 +36,9 @@
|
|||||||
***************************************************************************************/
|
***************************************************************************************/
|
||||||
// Include header file that defines the fonts loaded, the TFT drivers
|
// Include header file that defines the fonts loaded, the TFT drivers
|
||||||
// available and the pins to be used, etc, etc
|
// available and the pins to be used, etc, etc
|
||||||
|
#ifdef CONFIG_TFT_eSPI_ESPIDF
|
||||||
|
#include "TFT_config.h"
|
||||||
|
#endif
|
||||||
#include <User_Setup_Select.h>
|
#include <User_Setup_Select.h>
|
||||||
|
|
||||||
// Handle FLASH based storage e.g. PROGMEM
|
// Handle FLASH based storage e.g. PROGMEM
|
||||||
|
Loading…
Reference in New Issue
Block a user