From 87f9b9a8aa79e9bcb72641c3956f14d4af59bf02 Mon Sep 17 00:00:00 2001 From: Tobias Friebel Date: Tue, 20 Aug 2024 14:35:07 +0200 Subject: [PATCH] code cleanup --- src/lgfx/v1/touch/Touch_RA8875.cpp | 31 ++---------------------------- src/lgfx/v1/touch/Touch_RA8875.hpp | 2 -- 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/src/lgfx/v1/touch/Touch_RA8875.cpp b/src/lgfx/v1/touch/Touch_RA8875.cpp index 08b456a0..98619f12 100644 --- a/src/lgfx/v1/touch/Touch_RA8875.cpp +++ b/src/lgfx/v1/touch/Touch_RA8875.cpp @@ -45,9 +45,8 @@ namespace lgfx writeRegister8(0x71, 0x00 | 0x04); // Enable TP INT + // ToDo: you might want to mask the other bits of the register writeRegister8(0xF0, 0x04); - // better solution: - // writeReg(RA8875_INTC1, readReg(RA8875_INTC1) | RA8875_INTC1_TP); delay(2); writeRegister8(0xF1, 0x04); // clear interrupt @@ -58,7 +57,6 @@ namespace lgfx uint_fast8_t Touch_RA8875::getTouchRaw(touch_point_t* tp, uint_fast8_t count) { - // check int state F1h if (!_inited || count == 0) return 0; // ToDo: figure what count does // what does it do?? @@ -88,8 +86,7 @@ namespace lgfx tp->x = 0; tp->y = 0; tp->size = 0; - } - + } writeRegister8(0xF1, 0x04); // clear interrupt @@ -130,30 +127,6 @@ namespace lgfx lgfx::gpio_hi(_cfg.pin_cs); } } - - // uint8_t Touch_RA8875::readStat() - // { - // if (isSPI()) { - // uint8_t tmp[1] = {0xC0}; - // uint8_t res = 0; - - // digitalWrite(4, HIGH); - // spi::beginTransaction(_cfg.spi_host, _cfg.freq); - // lgfx::gpio_lo(_cfg.pin_cs); - - // spi::writeBytes(_cfg.spi_host, tmp, 1); - // spi::readBytes(_cfg.spi_host, &res, 3); - - // spi::endTransaction(_cfg.spi_host); - // lgfx::gpio_hi(_cfg.pin_cs); - // digitalWrite(4, LOW); - - // return res; - // } - // return 0; - // } - - //---------------------------------------------------------------------------- } } \ No newline at end of file diff --git a/src/lgfx/v1/touch/Touch_RA8875.hpp b/src/lgfx/v1/touch/Touch_RA8875.hpp index 00f7aa3a..9ea8d4fd 100644 --- a/src/lgfx/v1/touch/Touch_RA8875.hpp +++ b/src/lgfx/v1/touch/Touch_RA8875.hpp @@ -44,10 +44,8 @@ namespace lgfx uint_fast8_t getTouchRaw(touch_point_t* tp, uint_fast8_t count) override; private: - // int _spi_mode = 0; uint8_t readRegister8(uint8_t reg); void writeRegister8(uint8_t reg, uint8_t data); - // uint8_t readStat(); }; //----------------------------------------------------------------------------