Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warning >>>>------>> TOUCH_CS pin not defined in TFT_eSPI-2.4.50 #1788

Closed
stef-ladefense opened this issue Apr 21, 2022 · 6 comments
Closed

Comments

@stef-ladefense
Copy link

Hello,
I like warnings, it often avoids problems.
on the other hand, this is only valid if the screen actually has a touch .
otherwise, the warning appears for any screen without touch.

it would be wise to include in the xxxx_defines.h file screens without touch for example
#define NOTOUCH

and in the TFT_eSPI.h on line 875

#elif!defined(NO_TOUCH)
#warning >>>>------>> TOUCH_CS pin not defined, TFT_eSPI touch functions will not be available!
#endif

moreover, nothing prevents including a #define NOTOUCH manually in the User_Setup.h file in the case of non-use of the touch function of a screen which would be equipped with it.

What do you think ?

Regards,
Stéphane

@pentatonico
Copy link

Yes please!

@homonto
Copy link

homonto commented Apr 24, 2022

I came here just to say: I DON'T LIKE THIS WARNING ;-)
I like my compilation to be CLEAN and without the warnings where I don't expect them
just saying ;-)

reason being: my display ST7789 240x240 is not touch screen at all and CS pin is not in use - so I would not expect compilation warning in such case
and if I am not mistaken: CS pin is only in use if you have to use more than 1 SPI device so that the devices will know which one is being addressed, right? Nothing really to do with the "touch functions"

Bodmer added a commit that referenced this issue Apr 27, 2022
// Define in setup to disable all #warnings in library (can be put in User_Setup_Select.h)
#define DISABLE_ALL_LIBRARY_WARNINGS
@Bodmer
Copy link
Owner

Bodmer commented Apr 27, 2022

Added capability to stop alerts.

// Define in setup to disable all #warnings in library (can be put in User_Setup_Select.h)
#define DISABLE_ALL_LIBRARY_WARNINGS

@Bodmer Bodmer closed this as completed Apr 27, 2022
@chriskuku
Copy link

chriskuku commented Mar 28, 2024

Allow me to chime in here: my CYD device (cyd2usb) has capacitive touch and I'm wondering why I get this warning and the message that touch functions will not be available.

In file included from .pio/libdeps/cyd/TFT_eSPI/TFT_eSPI.cpp:16: .pio/libdeps/cyd/TFT_eSPI/TFT_eSPI.h:973:8: warning: #warning >>>>------>> TOUCH_CS pin not defined, TFT_eSPI touch functions will not be available! [-Wcpp] #warning >>>>------>> TOUCH_CS pin not defined, TFT_eSPI touch functions will not be available! ^~~~~~~

platform.ini:

[platformio]
src_dir = .
default_envs = cyd2usb

[env]
platform = espressif32
board = esp32dev
framework = arduino
lib_deps = 
	bodmer/TFT_eSPI@^2.5.33
monitor_speed = 115200
monitor_filters = esp32_exception_decoder
# upload_speed = 921600
upload_speed = 460800
board_build.partitions=min_spiffs.csv
build_flags =
	-DUSER_SETUP_LOADED
	-DILI9341_2_DRIVER
	-DUSE_HSPI_PORT
	-DTFT_WIDTH=240
	-DTFT_HEIGHT=320
	-DTFT_MISO=12
	-DTFT_MOSI=13
	-DTFT_SCLK=14
	-DTFT_CS=15
	-DTFT_DC=2
	-DTFT_RST=-1
	-DTFT_BL=21
	-DTFT_BACKLIGHT_ON=HIGH
	-DTFT_BACKLIGHT_OFF=LOW
	-DLOAD_GLCD
	-DSPI_FREQUENCY=55000000
	-DSPI_READ_FREQUENCY=20000000
	-DSPI_TOUCH_FREQUENCY=2500000
	-DLOAD_FONT2
	-DLOAD_FONT4
	-DLOAD_FONT6
	-DLOAD_FONT7
	-DLOAD_FONT8
	-DLOAD_GFXFF

[env:cyd]
build_flags =
	${env.build_flags}
	-DTFT_INVERSION_OFF

[env:cyd2usb]
build_flags =
	${env.build_flags}
	-DTFT_INVERSION_ON

@zRCrackiiN
Copy link

Allow me to chime in here: my CYD device (cyd2usb) has capacitive touch and I'm wondering why I get this warning and the message that touch functions will not be available.

In file included from .pio/libdeps/cyd/TFT_eSPI/TFT_eSPI.cpp:16: .pio/libdeps/cyd/TFT_eSPI/TFT_eSPI.h:973:8: warning: #warning >>>>------>> TOUCH_CS pin not defined, TFT_eSPI touch functions will not be available! [-Wcpp] #warning >>>>------>> TOUCH_CS pin not defined, TFT_eSPI touch functions will not be available! ^~~~~~~

platform.ini:

[platformio]
src_dir = .
default_envs = cyd2usb

[env]
platform = espressif32
board = esp32dev
framework = arduino
lib_deps = 
	bodmer/TFT_eSPI@^2.5.33
monitor_speed = 115200
monitor_filters = esp32_exception_decoder
# upload_speed = 921600
upload_speed = 460800
board_build.partitions=min_spiffs.csv
build_flags =
	-DUSER_SETUP_LOADED
	-DILI9341_2_DRIVER
	-DUSE_HSPI_PORT
	-DTFT_WIDTH=240
	-DTFT_HEIGHT=320
	-DTFT_MISO=12
	-DTFT_MOSI=13
	-DTFT_SCLK=14
	-DTFT_CS=15
	-DTFT_DC=2
	-DTFT_RST=-1
	-DTFT_BL=21
	-DTFT_BACKLIGHT_ON=HIGH
	-DTFT_BACKLIGHT_OFF=LOW
	-DLOAD_GLCD
	-DSPI_FREQUENCY=55000000
	-DSPI_READ_FREQUENCY=20000000
	-DSPI_TOUCH_FREQUENCY=2500000
	-DLOAD_FONT2
	-DLOAD_FONT4
	-DLOAD_FONT6
	-DLOAD_FONT7
	-DLOAD_FONT8
	-DLOAD_GFXFF

[env:cyd]
build_flags =
	${env.build_flags}
	-DTFT_INVERSION_OFF

[env:cyd2usb]
build_flags =
	${env.build_flags}
	-DTFT_INVERSION_ON

samesies! its weird! ive defined the touch_cs pin in user_setup.h so im confused...

@morfeus2
Copy link

morfeus2 commented May 5, 2024

I would also be in favor of a #define NOTOUCH, because I am not able to find a clean solution.
I have a screen without touch and if I use:
#define TOUCH_CS -1
I get:
#error Touch screen not supported in parallel or SPI PIO mode, use a separate library.
If I don't define TOUCH_CS, I get the warning.
I would avoid "DISABLE_ALL_LIBRARY_WARNINGS" because I want to be able to see other possible warnings.
Up to now I did not find a way to choose to disable touch at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants