mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-29 13:46:37 +00:00
Rename define MAX_TOUCH_BUTTONS
This commit is contained in:
parent
14788a4e74
commit
398e29d7cf
@ -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
|
||||
|
@ -300,7 +300,7 @@ extern FS *ufsp;
|
||||
#ifdef USE_DISPLAY
|
||||
#ifdef USE_TOUCH_BUTTONS
|
||||
#include <renderer.h>
|
||||
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;
|
||||
|
@ -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; count<MAXBUTTONS; count++) {
|
||||
for (uint8_t count=0; count<MAX_TOUCH_BUTTONS; count++) {
|
||||
if (buttons[count] && !buttons[count]->vpower.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; count<MAXBUTTONS; count++) {
|
||||
for (uint8_t count=0; count<MAX_TOUCH_BUTTONS; count++) {
|
||||
if (buttons[count]) {
|
||||
buttons[count]->press(false);
|
||||
if (buttons[count]->justReleased()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user