diff --git a/tasmota/tasmota_configurations_ESP32.h b/tasmota/tasmota_configurations_ESP32.h index 60da5dfe9..874da5306 100644 --- a/tasmota/tasmota_configurations_ESP32.h +++ b/tasmota/tasmota_configurations_ESP32.h @@ -89,7 +89,7 @@ #define USE_DISPLAY #define USE_DISPLAY_ILI9342 #define USE_TOUCH_BUTTONS - #define MAXBUTTONS 16 + #define MAX_TOUCH_BUTTONS 16 #define JPEG_PICTS #define USE_FT5206 #define USE_MPU6886 diff --git a/tasmota/xdrv_10_scripter.ino b/tasmota/xdrv_10_scripter.ino index 85463bdb7..b5f7a7890 100755 --- a/tasmota/xdrv_10_scripter.ino +++ b/tasmota/xdrv_10_scripter.ino @@ -300,7 +300,7 @@ extern FS *ufsp; #ifdef USE_DISPLAY #ifdef USE_TOUCH_BUTTONS #include -extern VButton *buttons[MAXBUTTONS]; +extern VButton *buttons[MAX_TOUCH_BUTTONS]; #endif #endif @@ -3044,7 +3044,7 @@ chknext: if (!strncmp(vname, "tbut[", 5)) { GetNumericArgument(vname + 5, OPER_EQU, &fvar, 0); uint8_t index = fvar; - if (index<1 || index>MAXBUTTONS) index = 1; + if (index<1 || index>MAX_TOUCH_BUTTONS) index = 1; index--; if (buttons[index]) { fvar = buttons[index]->vpower.on_off; diff --git a/tasmota/xdrv_13_display.ino b/tasmota/xdrv_13_display.ino index a85fda316..d2efd21c2 100755 --- a/tasmota/xdrv_13_display.ino +++ b/tasmota/xdrv_13_display.ino @@ -28,12 +28,12 @@ Renderer *renderer; enum ColorType { COLOR_BW, COLOR_COLOR }; -#ifndef MAXBUTTONS -#define MAXBUTTONS 16 +#ifndef MAX_TOUCH_BUTTONS +#define MAX_TOUCH_BUTTONS 16 #endif #ifdef USE_TOUCH_BUTTONS -VButton *buttons[MAXBUTTONS]; +VButton *buttons[MAX_TOUCH_BUTTONS]; #endif // drawing color is WHITE @@ -772,7 +772,7 @@ void DisplayText(void) if (*cp=='d') dis=1; cp++; var=atoiv(cp,&num); - num=num%MAXBUTTONS; + num=num%MAX_TOUCH_BUTTONS; cp+=var; if (buttons[num]) { buttons[num]->vpower.disable=dis; @@ -791,7 +791,7 @@ void DisplayText(void) cp+=var; cp++; uint8_t bflags=num>>8; - num=num%MAXBUTTONS; + num=num%MAX_TOUCH_BUTTONS; var=atoiv(cp,&gxp); cp+=var; cp++; @@ -2188,7 +2188,7 @@ uint8_t vbutt=0; //AddLog_P(LOG_LEVEL_INFO, PSTR("touch %d - %d"), pLoc.x, pLoc.y); // now must compare with defined buttons - for (uint8_t count=0; countvpower.disable) { if (buttons[count]->contains(pLoc.x, pLoc.y)) { // did hit @@ -2237,7 +2237,7 @@ uint8_t vbutt=0; } } #endif - for (uint8_t count=0; countpress(false); if (buttons[count]->justReleased()) {