Skip to content

Commit c695985

Browse files
committed
prepare for ESP32S3
1 parent 7734410 commit c695985

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

lib/tftLib/src/tft.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "pins_arduino.h"
77

88
JPEGDecoder JpegDec;
9+
SPIClass* SPItransfer;
910

1011
#define TFT_MAX_PIXELS_AT_ONCE 32
1112

@@ -506,6 +507,7 @@ void TFT::begin(uint8_t CS, uint8_t DC, uint8_t spi, uint8_t mosi, uint8_t miso,
506507
spi_TFT = new SPIClass(spi);
507508
spi_TFT->begin(sclk, miso, mosi, -1);
508509
spi_TFT->setFrequency(_freq);
510+
SPItransfer = spi_TFT;
509511

510512
TFT_SPI = SPISettings(_freq, MSBFIRST, SPI_MODE0);
511513

@@ -4268,12 +4270,12 @@ TP::TP(uint8_t CS, uint8_t IRQ) {
42684270

42694271
uint16_t TP::TP_Send(uint8_t set_val) {
42704272
uint16_t get_val;
4271-
TFT::spi_TFT->beginTransaction(TP_SPI); // Prevent other SPI users
4273+
SPItransfer->beginTransaction(TP_SPI); // Prevent other SPI users
42724274
digitalWrite(TP_CS, 0);
4273-
TFT::spi_TFT->write(set_val);
4274-
get_val = TFT::spi_TFT->transfer16(0);
4275+
SPItransfer->write(set_val);
4276+
get_val = SPItransfer->transfer16(0);
42754277
digitalWrite(TP_CS, 1);
4276-
TFT::spi_TFT->endTransaction(); // Allow other SPI users
4278+
SPItransfer->endTransaction(); // Allow other SPI users
42774279
return get_val >> 4;
42784280
}
42794281

lib/tftLib/src/tft.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ virtual size_t write(const uint8_t *buffer, size_t size);
201201
uint8_t _TFTcontroller = ILI9341;
202202

203203
SPISettings TFT_SPI; // SPI settings for this slave
204-
public:
205204
SPIClass* spi_TFT = NULL; // use in class TP
206205
private:
207206
uint32_t _freq;

platformio.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
;platform = https://github.com/platformio/platform-espressif32.git#v4.2.0
1313
platform = https://github.com/platformio/platform-espressif32.git#v4.4.0
1414

15-
;board = esp32dev
16-
board = um_tinys3
15+
board = esp32dev
16+
;board = um_tinys3
1717

1818
board_build.f_cpu = 240000000L
1919
board_build.flash_size=4MB

0 commit comments

Comments
 (0)