mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-27 21:26:43 +00:00
Lovyan Resistive Touch calibration #220
This commit is contained in:
parent
e9ef961ef8
commit
4bc2cd5e24
@ -573,11 +573,11 @@ void LovyanGfx::init(int w, int h)
|
||||
auto cfg = _touch_instance->config();
|
||||
cfg.x_min = 300;
|
||||
cfg.x_max = 3900;
|
||||
cfg.y_min = 200;
|
||||
cfg.y_max = 3700;
|
||||
cfg.y_min = 3700;
|
||||
cfg.y_max = 200;
|
||||
cfg.pin_int = -1;
|
||||
cfg.bus_shared = false;
|
||||
cfg.offset_rotation = 6;
|
||||
cfg.offset_rotation = TOUCH_OFFSET_ROTATION;
|
||||
cfg.spi_host = VSPI_HOST;
|
||||
cfg.freq = 1000000;
|
||||
cfg.pin_sclk = 25;
|
||||
@ -617,6 +617,13 @@ void LovyanGfx::init(int w, int h)
|
||||
tft.begin();
|
||||
LOG_DEBUG(TAG_TFT, F("%s - %d"), __FILE__, __LINE__);
|
||||
tft.setSwapBytes(true); /* set endianess */
|
||||
|
||||
// #if esp32_2432S028R
|
||||
// LOG_VERBOSE(TAG_TFT, "Setting up touch calibration for esp32_2432S028R")
|
||||
// uint16_t calData[] = {239, 3926, 233, 265, 3856, 3896, 3714, 308};
|
||||
// tft.setTouchCalibrate(calData);
|
||||
// #endif
|
||||
|
||||
LOG_INFO(TAG_TFT, F(D_SERVICE_STARTED));
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,6 @@ class TouchLovyanGfx : public BaseTouch {
|
||||
|
||||
void calibrate(uint16_t* calData)
|
||||
{
|
||||
/*
|
||||
|
||||
haspTft.tft.fillScreen(TFT_BLACK);
|
||||
// haspTft.tft.setCursor(20, 0);
|
||||
@ -70,7 +69,6 @@ class TouchLovyanGfx : public BaseTouch {
|
||||
haspTft.tft.calibrateTouch(calData, TFT_MAGENTA, TFT_BLACK, 15);
|
||||
// haspTft.tft.setTouch(calData);
|
||||
|
||||
*/
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -479,7 +479,7 @@ bool guiGetConfig(const JsonObject& settings)
|
||||
#if TOUCH_DRIVER == 0x2046 && defined(USER_SETUP_LOADED) && defined(TOUCH_CS)
|
||||
// tft_espi_set_touch(gui_settings.cal_data);
|
||||
haspTft.tft.setTouch(gui_settings.cal_data);
|
||||
#elif 0
|
||||
#elif TOUCH_DRIVER == 0x2046 && defined(HASP_USE_LGFX_TOUCH)
|
||||
haspTft.tft.setTouchCalibrate(gui_settings.cal_data);
|
||||
#endif
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ build_flags =
|
||||
-D SUPPORT_TRANSACTIONS
|
||||
-D SPI_FREQUENCY=55000000
|
||||
-D SPI_READ_FREQUENCY=20000000
|
||||
-D TOUCH_OFFSET_ROTATION=0 ; 1=swap xy, 2=invert x, 4=inverty
|
||||
|
||||
-D ESP32_2432S028R=1
|
||||
;endregion
|
||||
|
Loading…
x
Reference in New Issue
Block a user