Update esptool to3.3.1

This commit is contained in:
fvanroie 2022-10-18 01:08:02 +02:00
parent 22d4360a2f
commit d0ab4d7e96
4 changed files with 1545 additions and 554 deletions

View File

@ -49,9 +49,18 @@ class BaseTouch {
#endif
#if TOUCH_DRIVER == 0x2046 && defined(USER_SETUP_LOADED)
#warning Building for XPT2046
#warning Building for TFT_eSPI XPT2046
//#include "touch_driver_xpt2046.h"
#include "touch_driver_tftespi.h"
#elif TOUCH_DRIVER == 0x2046 && defined(LGFX_USE_V1) && defined(HASP_USE_LGFX_TOUCH)
#warning Building for LovyanGFX XPT2046
#include "touch_driver_lovyangfx.h"
#elif TOUCH_DRIVER == 0x0911 && defined(LGFX_USE_V1) && defined(HASP_USE_LGFX_TOUCH)
#warning Building for LovyanGFX GT911
#include "touch_driver_lovyangfx.h"
#elif TOUCH_DRIVER == 0x6336 && defined(LGFX_USE_V1) && defined(HASP_USE_LGFX_TOUCH)
#warning Building for LovyanGFX FT6336
#include "touch_driver_lovyangfx.h"
#elif TOUCH_DRIVER == 0x5206
#warning Building for FT5206
#include "touch_driver_ft5206.h"

View File

@ -4,9 +4,10 @@
#ifndef HASP_LOVYANGFX_TOUCH_DRIVER_H
#define HASP_LOVYANGFX_TOUCH_DRIVER_H
#ifdef ARDUINO
#if defined(ARDUINO) && defined(LGFX_USE_V1) && defined(HASP_USE_LGFX_TOUCH)
#include <Arduino.h>
#include <Wire.h>
#include "LovyanGFX.hpp"
#include "touch_driver.h" // base class
#include "touch_helper.h" // wire scan
@ -23,20 +24,21 @@ class TouchLovyanGfx : public BaseTouch {
public:
IRAM_ATTR bool read(lv_indev_drv_t* indev_driver, lv_indev_data_t* data)
{
int16_t touchX = 0;
int16_t touchY = 0;
lgfx::v1::touch_point_t tp;
if(haspTft.tft.getTouch((uint16_t*)&touchX, (uint16_t*)&touchY)) {
if(haspTft.tft.getTouch(&tp, 1)) {
if(hasp_sleep_state != HASP_SLEEP_OFF) hasp_update_sleep_state(); // update Idle
data->point.x = touchX;
data->point.y = touchY;
data->point.x = tp.x;
data->point.y = tp.y;
data->state = LV_INDEV_STATE_PR;
hasp_set_sleep_offset(0); // Reset the offset
LOG_VERBOSE(TAG_DRVR, F("Touch: %d %d"), touchX, touchY);
LOG_DEBUG(TAG_DRVR, F("Touch: %d %d"), tp.x, tp.y);
// HASP_SERIAL.print('#');
} else {
data->state = LV_INDEV_STATE_REL;
// HASP_SERIAL.print('x');
}
/*Return `false` because we are not buffering and no more data to read*/
@ -52,14 +54,14 @@ class TouchLovyanGfx : public BaseTouch {
void calibrate(uint16_t* calData)
{
haspTft.tft.fillScreen(TFT_BLACK);
haspTft.tft.setCursor(20, 0);
haspTft.tft.setTextFont(1);
haspTft.tft.setTextSize(1);
haspTft.tft.setTextColor(TFT_WHITE, TFT_BLACK);
// haspTft.tft.setCursor(20, 0);
// haspTft.tft.setTextFont(1);
// haspTft.tft.setTextSize(1);
// haspTft.tft.setTextColor(TFT_WHITE, TFT_BLACK);
// tft.println(PSTR("Touch corners as indicated"));
// // tft.println(PSTR("Touch corners as indicated"));
haspTft.tft.setTextFont(1);
// haspTft.tft.setTextFont(1);
delay(500);
haspTft.tft.calibrateTouch(calData, TFT_MAGENTA, TFT_BLACK, 15);
// haspTft.tft.setTouch(calData);
@ -68,6 +70,7 @@ class TouchLovyanGfx : public BaseTouch {
} // namespace dev
#warning Using Lovyan Touch
using dev::TouchLovyanGfx;
extern dev::TouchLovyanGfx haspTouch;

View File

@ -279,7 +279,8 @@ void guiSetup()
font_setup();
/* Initialize the LVGL display driver with correct orientation */
#if(TOUCH_DRIVER == 0x2046) // || defined(LGFX_USE_V1) // Use native display driver to rotate display and touch
#if(TOUCH_DRIVER == 0x2046) || \
(defined(LGFX_USE_V1) && defined(HASP_USE_LGFX_TOUCH)) // Use native display driver to rotate display and touch
static lv_disp_drv_t disp_drv;
lv_disp_drv_init(&disp_drv);
disp_drv.buffer = &disp_buf;

File diff suppressed because it is too large Load Diff