Debug USE_UFILESYS

This commit is contained in:
nonix 2021-02-25 10:58:33 +01:00
parent 1d6fea927c
commit 43946f4ca7
4 changed files with 63 additions and 8 deletions

View File

@ -775,6 +775,7 @@
#define D_SENSOR_RC522_CS "RC522 CS"
#define D_SENSOR_NRF24_CS "NRF24 CS"
#define D_SENSOR_NRF24_DC "NRF24 DC"
#define D_SENSOR_XPT2046_CS "XPT2046 CS"
#define D_SENSOR_ILI9341_CS "ILI9341 CS"
#define D_SENSOR_ILI9341_DC "ILI9341 DC"
#define D_SENSOR_ILI9488_CS "ILI9488 CS"

View File

@ -150,6 +150,10 @@ enum UserSelectablePins {
GPIO_NEOPOOL_TX, GPIO_NEOPOOL_RX, // Sugar Valley RS485 interface
GPIO_SDM72_TX, GPIO_SDM72_RX, // SDM72 Serial interface
GPIO_TM1637CLK, GPIO_TM1637DIO, // TM1637 interface
#ifdef USE_XPT2046
GPIO_XPT2046_CS, // XPT2046 SPI Chip Select
#endif
GPIO_SENSOR_END };
enum ProgramSelectablePins {
@ -320,6 +324,7 @@ const char kSensorNames[] PROGMEM =
D_SENSOR_NEOPOOL_TX "|" D_SENSOR_NEOPOOL_RX "|"
D_SENSOR_SDM72_TX "|" D_SENSOR_SDM72_RX "|"
D_SENSOR_TM1637_CLK "|" D_SENSOR_TM1637_DIO "|"
D_SENSOR_XPT2046_CS "|"
;
const char kSensorNamesFixed[] PROGMEM =
@ -409,6 +414,10 @@ const uint16_t kGpioNiceList[] PROGMEM = {
#ifdef USE_DISPLAY_ILI9341
AGPIO(GPIO_ILI9341_CS),
AGPIO(GPIO_ILI9341_DC),
#ifdef USE_XPT2046
AGPIO(GPIO_XPT2046_CS), // XPT2046 SPI Chip Select
#endif
#endif // USE_DISPLAY_ILI9341
#ifdef USE_DISPLAY_ILI9488
AGPIO(GPIO_ILI9488_CS),

View File

@ -2018,7 +2018,6 @@ void CmndDisplayRows(void)
/*********************************************************************************************\
* optional drivers
\*********************************************************************************************/
#ifdef USE_TOUCH_BUTTONS
// very limited path size, so, add .jpg
void draw_picture(char *path, uint32_t xp, uint32_t yp, uint32_t xs, uint32_t ys, uint32_t ocol, bool inverted) {
@ -2041,7 +2040,6 @@ char ppath[16];
}
#endif
#ifdef ESP32
#ifdef JPEG_PICTS
#include "img_converters.h"
@ -2573,6 +2571,7 @@ void AddValue(uint8_t num,float fval) {
}
#endif // USE_GRAPH
#if defined(USE_FT5206) || defined(USE_XPT2046)
#ifdef USE_FT5206
#include <FT5206.h>
@ -2609,7 +2608,38 @@ uint32_t Touch_Status(uint32_t sel) {
return 0;
}
}
#endif
#if defined(USE_XPT2046) && defined(USE_DISPLAY_ILI9341)
#include <XPT2046_Touchscreen.h>
XPT2046_Touchscreen *touchp;
TS_Point pLoc;
bool XPT2046_found;
bool Touch_Init(uint16_t CS) {
touchp = new XPT2046_Touchscreen(CS);
XPT2046_found = touchp->begin();
return XPT2046_found;
}
uint32_t Touch_Status(uint32_t sel) {
if (XPT2046_found) {
switch (sel) {
case 0:
return touchp->touched();
case 1:
return pLoc.x;
case 2:
return pLoc.y;
}
return 0;
} else {
return 0;
}
}
#endif
#ifdef USE_TOUCH_BUTTONS
void Touch_MQTT(uint8_t index, const char *cp, uint32_t val) {
@ -2636,8 +2666,11 @@ uint8_t vbutt=0;
if (touchp->touched()) {
// did find a hit
#if defined(USE_FT5206)
pLoc = touchp->getPoint(0);
#elif defined(USE_XPT2046)
pLoc = touchp->getPoint();
#endif
if (renderer) {
#ifdef USE_M5STACK_CORE2

View File

@ -29,9 +29,12 @@ extern uint8_t *buffer;
extern uint8_t color_type;
ILI9341_2 *ili9341_2;
#ifdef USE_FT5206
#if defined(USE_FT5206)
#include <FT5206.h>
uint8_t ili9342_ctouch_counter = 0;
#elif defined(USE_XPT2046)
#include <XPT2046_Touchscreen.h>
uint8_t ili9342_ctouch_counter = 0;
#endif // USE_FT5206
bool tft_init_done = false;
@ -136,6 +139,10 @@ void ILI9341_InitDriver()
#endif // USE_FT5206
#endif // ESP32
#ifdef USE_XPT2046
Touch_Init(Pin(GPIO_XPT2046_CS));
#endif
tft_init_done = true;
#ifdef USE_DISPLAY_ILI9341
AddLog(LOG_LEVEL_INFO, PSTR("DSP: ILI9341"));
@ -160,8 +167,8 @@ void ili9342_dimm(uint8_t dim) {
#endif
}
#ifdef ESP32
#ifdef USE_FT5206
//#ifdef ESP32
#if defined(USE_FT5206) || defined(USE_XPT2046)
#ifdef USE_TOUCH_BUTTONS
void ili9342_RotConvert(int16_t *x, int16_t *y) {
@ -201,7 +208,7 @@ ili9342_ctouch_counter++;
}
#endif // USE_TOUCH_BUTTONS
#endif // USE_FT5206
#endif // ESP32
//#endif // ESP32
#ifdef USE_DISPLAY_MODES1TO5
@ -360,10 +367,15 @@ bool Xdsp04(uint8_t function)
case DISPLAY_INIT_MODE:
renderer->clearDisplay();
break;
#ifdef USE_FT5206
#if defined(USE_FT5206) || defined(USE_XPT2046)
#ifdef USE_TOUCH_BUTTONS
case FUNC_DISPLAY_EVERY_50_MSECOND:
#if defined(USE_FT5206)
if (FT5206_found) {
#elif defined(USE_XPT2046)
if (XPT2046_found) {
#endif
ili9342_CheckTouch();
}
break;