mirror of https://github.com/arendst/Tasmota.git
Update xdsp_08_ILI9488.ino
This commit is contained in:
parent
1f4b2f7ae5
commit
b67c0d129c
|
@ -159,106 +159,6 @@ void ILI9488_CheckTouch(void) {
|
|||
#endif // USE_TOUCH_BUTTONS
|
||||
#endif // USE_FT5206
|
||||
|
||||
/*
|
||||
// check digitizer hit
|
||||
void FT6236Check() {
|
||||
uint16_t temp;
|
||||
uint8_t rbutt=0,vbutt=0;
|
||||
ili9488_ctouch_counter++;
|
||||
if (2 == ili9488_ctouch_counter) {
|
||||
// every 100 ms should be enough
|
||||
ili9488_ctouch_counter=0;
|
||||
if (FT6236readTouchLocation(&ili9488_pLoc,1)) {
|
||||
// did find a hit
|
||||
if (renderer) {
|
||||
uint8_t rot=renderer->getRotation();
|
||||
switch (rot) {
|
||||
case 0:
|
||||
temp=ili9488_pLoc.y;
|
||||
ili9488_pLoc.y=renderer->height()-ili9488_pLoc.x;
|
||||
ili9488_pLoc.x=temp;
|
||||
break;
|
||||
case 1:
|
||||
break;
|
||||
case 2:
|
||||
break;
|
||||
case 3:
|
||||
temp=ili9488_pLoc.y;
|
||||
ili9488_pLoc.y=ili9488_pLoc.x;
|
||||
ili9488_pLoc.x=renderer->width()-temp;
|
||||
break;
|
||||
}
|
||||
// now must compare with defined buttons
|
||||
for (uint8_t count=0; count<MAXBUTTONS; count++) {
|
||||
if (buttons[count]) {
|
||||
if (buttons[count]->contains(ili9488_pLoc.x,ili9488_pLoc.y)) {
|
||||
// did hit
|
||||
buttons[count]->press(true);
|
||||
if (buttons[count]->justPressed()) {
|
||||
if (!buttons[count]->vpower.is_virtual) {
|
||||
uint8_t pwr=bitRead(power,rbutt);
|
||||
if (!SendKey(KEY_BUTTON, rbutt+1, POWER_TOGGLE)) {
|
||||
ExecuteCommandPower(rbutt+1, POWER_TOGGLE, SRC_BUTTON);
|
||||
ILI9488_RDW_BUTT(count,!pwr);
|
||||
}
|
||||
} else {
|
||||
// virtual button
|
||||
const char *cp;
|
||||
if (!buttons[count]->vpower.is_pushbutton) {
|
||||
// toggle button
|
||||
buttons[count]->vpower.on_off^=1;
|
||||
cp="TBT";
|
||||
} else {
|
||||
// push button
|
||||
buttons[count]->vpower.on_off=1;
|
||||
cp="PBT";
|
||||
}
|
||||
buttons[count]->xdrawButton(buttons[count]->vpower.on_off);
|
||||
ILI9488_MQTT(count,cp);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!buttons[count]->vpower.is_virtual) {
|
||||
rbutt++;
|
||||
} else {
|
||||
vbutt++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// no hit
|
||||
for (uint8_t count=0; count<MAXBUTTONS; count++) {
|
||||
if (buttons[count]) {
|
||||
buttons[count]->press(false);
|
||||
if (buttons[count]->justReleased()) {
|
||||
if (buttons[count]->vpower.is_virtual) {
|
||||
if (buttons[count]->vpower.is_pushbutton) {
|
||||
// push button
|
||||
buttons[count]->vpower.on_off=0;
|
||||
ILI9488_MQTT(count,"PBT");
|
||||
}
|
||||
buttons[count]->xdrawButton(buttons[count]->vpower.on_off);
|
||||
}
|
||||
}
|
||||
if (!buttons[count]->vpower.is_virtual) {
|
||||
// check if power button stage changed
|
||||
uint8_t pwr=bitRead(power,rbutt);
|
||||
uint8_t vpwr=buttons[count]->vpower.on_off;
|
||||
if (pwr!=vpwr) {
|
||||
ILI9488_RDW_BUTT(count,pwr);
|
||||
}
|
||||
rbutt++;
|
||||
}
|
||||
}
|
||||
}
|
||||
ili9488_pLoc.x=0;
|
||||
ili9488_pLoc.y=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // USE_TOUCH_BUTTONS
|
||||
*/
|
||||
|
||||
/*********************************************************************************************/
|
||||
/*********************************************************************************************\
|
||||
|
|
Loading…
Reference in New Issue