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

error with Touch.cpp #3586

Open
Sinamajidi opened this issue Dec 18, 2024 · 0 comments
Open

error with Touch.cpp #3586

Sinamajidi opened this issue Dec 18, 2024 · 0 comments

Comments

@Sinamajidi
Copy link

when I start building my program there is an absolute error with Touch.cpp that I don't know how to solve. (Touch.cpp is not changed.)

I'm using platform io btw.

here is the error:

In file included from src/main.cpp:12:
src/..\lib\TFT_eSPI\Extensions\Touch.cpp: In member function 'void TFT_eSPI::begin_touch_read_write()':
src/..\lib\TFT_eSPI\Extensions\Touch.cpp:27:34: error: 'spi' was not declared in this scope
     if (locked) {locked = false; spi.beginTransaction(SPISettings(SPI_TOUCH_FREQUENCY, MSBFIRST, SPI_MODE0));}
                                  ^~~
src/..\lib\TFT_eSPI\Extensions\Touch.cpp:27:34: note: suggested alternative: 'sei'
     if (locked) {locked = false; spi.beginTransaction(SPISettings(SPI_TOUCH_FREQUENCY, MSBFIRST, SPI_MODE0));}
                                  ^~~
                                  sei
In file included from lib/TFT_eSPI/TFT_eSPI.h:101,
                 from src/main.cpp:7:
lib/TFT_eSPI/Processors/TFT_eSPI_ESP32.h:111:33: error: '_spi_user' was not declared in this scope
     #define SET_BUS_READ_MODE  *_spi_user = SPI_USR_MOSI | SPI_USR_MISO | SPI_DOUTDIN
                                 ^~~~~~~~~
src/..\lib\TFT_eSPI\Extensions\Touch.cpp:31:3: note: in expansion of macro 'SET_BUS_READ_MODE'
   SET_BUS_READ_MODE;
   ^~~~~~~~~~~~~~~~~
In file included from src/main.cpp:12:
src/..\lib\TFT_eSPI\Extensions\Touch.cpp: In member function 'void TFT_eSPI::end_touch_read_write()':
src/..\lib\TFT_eSPI\Extensions\Touch.cpp:42:54: error: 'spi' was not declared in this scope
     if(!inTransaction) {if (!locked) {locked = true; spi.endTransaction();}}
                                                      ^~~
src/..\lib\TFT_eSPI\Extensions\Touch.cpp:42:54: note: suggested alternative: 'sei'
     if(!inTransaction) {if (!locked) {locked = true; spi.endTransaction();}}
                                                      ^~~
                                                      sei
src/..\lib\TFT_eSPI\Extensions\Touch.cpp: In member function 'uint8_t TFT_eSPI::getTouchRaw(uint16_t*, uint16_t*)':
src/..\lib\TFT_eSPI\Extensions\Touch.cpp:66:3: error: 'spi' was not declared in this scope
   spi.transfer(0xd0);                    // Start new YP conversion
   ^~~
src/..\lib\TFT_eSPI\Extensions\Touch.cpp:66:3: note: suggested alternative: 'sei'
   spi.transfer(0xd0);                    // Start new YP conversion
   ^~~
   sei
src/..\lib\TFT_eSPI\Extensions\Touch.cpp: In member function 'uint16_t TFT_eSPI::getTouchRawZ()':
src/..\lib\TFT_eSPI\Extensions\Touch.cpp:109:3: error: 'spi' was not declared in this scope
   spi.transfer(0xb0);               // Start new Z1 conversion
   ^~~
src/..\lib\TFT_eSPI\Extensions\Touch.cpp:109:3: note: suggested alternative: 'sei'
   spi.transfer(0xb0);               // Start new Z1 conversion
   ^~~
   sei
*** [.pio\build\esp32doit-devkit-v1\src\main.cpp.o] Error 1
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

1 participant