Add disable touch

This commit is contained in:
Just Call Me Koko
2024-02-04 13:43:01 -05:00
parent 24a1862ef6
commit b5337fcff5
6 changed files with 129 additions and 64 deletions

View File

@@ -200,7 +200,10 @@ PROGMEM static const unsigned char menu_icons[][66] = {
0x1F, 0xD0, 0x3F, 0x3F, 0xE0, 0x3F, 0x5F, 0xF0, 0x3F, 0xEF, 0xE8, 0x3F,
0xF7, 0xE5, 0x3B, 0xFB, 0xDE, 0x3A, 0x7D, 0xFF, 0x3A, 0xBB, 0x7F, 0x3B,
0xD7, 0x9F, 0x3D, 0xEF, 0xFF, 0x3E, 0xFF, 0x0F, 0x3F, 0xFF, 0xFF, 0x3F,
0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F}
0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F},
{0xFF, 0xFF, 0xFD, 0xBF, 0x0B, 0xD0, 0xE7, 0xE7, 0xEF, 0xF7, 0xCF, 0xF3, // DISABLED TOUCH: 34
0xAF, 0xF5, 0x6F, 0xF6, 0x6F, 0xF6, 0xAF, 0xF5, 0xCF, 0xF3, 0x0F, 0xF0,
0xE7, 0xE7, 0x0B, 0xD0, 0xFD, 0xBF, 0xFF, 0xFF}
};
#ifndef MARAUDER_MINI

View File

@@ -548,6 +548,7 @@ void MenuFunctions::main(uint32_t currentTime)
// getTouch causes a 10ms delay which makes beacon spam less effective
#ifdef HAS_ILI9341
if (!this->disable_touch)
pressed = this->updateTouch(&t_x, &t_y);
#endif
@@ -616,6 +617,8 @@ void MenuFunctions::main(uint32_t currentTime)
bool c_btn_press = c_btn.justPressed();
#ifndef HAS_ILI9341
if ((c_btn_press) &&
(wifi_scan_obj.currentScanMode != WIFI_SCAN_OFF) &&
(wifi_scan_obj.currentScanMode != OTA_UPDATE) &&
@@ -676,6 +679,7 @@ void MenuFunctions::main(uint32_t currentTime)
return;
}
#endif
#endif
@@ -989,7 +993,23 @@ void MenuFunctions::updateStatusBar()
}
// Draw battery info
MenuFunctions::battery(false);
//MenuFunctions::battery(false);
display_obj.tft.fillRect(190, 0, SCREEN_WIDTH, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
#ifdef HAS_ILI9341
#ifdef HAS_BUTTONS
if (this->disable_touch) {
display_obj.tft.setCursor(0, 1);
display_obj.tft.drawXBitmap(190,
0,
menu_icons[DISABLE_TOUCH],
16,
16,
STATUSBAR_COLOR,
TFT_RED);
}
#endif
#endif
// Draw SD info
@@ -1075,7 +1095,23 @@ void MenuFunctions::drawStatusBar()
#endif
MenuFunctions::battery2(true);
//MenuFunctions::battery2(true);
display_obj.tft.fillRect(190, 0, SCREEN_WIDTH, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
#ifdef HAS_ILI9341
#ifdef HAS_BUTTONS
if (this->disable_touch) {
display_obj.tft.setCursor(0, 1);
display_obj.tft.drawXBitmap(190,
0,
menu_icons[DISABLE_TOUCH],
16,
16,
STATUSBAR_COLOR,
TFT_RED);
}
#endif
#endif
// Draw SD info
if (sd_obj.supported)
@@ -1169,6 +1205,8 @@ void MenuFunctions::RunSetup()
{
extern LinkedList<AccessPoint>* access_points;
this->disable_touch = false;
#ifdef HAS_ILI9341
this->initLVGL();
#endif

View File

@@ -71,6 +71,7 @@ extern Settings settings_obj;
#define LANGUAGE 31
#define STATUS_GPS 32
#define GPS_MENU 33
#define DISABLE_TOUCH 34
PROGMEM void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p);
PROGMEM bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data);
@@ -121,7 +122,6 @@ class MenuFunctions
uint32_t initTime = 0;
uint8_t menu_start_index = 0;
// Main menu stuff
Menu mainMenu;
@@ -163,7 +163,6 @@ class MenuFunctions
void addNodes(Menu* menu, String name, uint16_t color, Menu* child, int place, std::function<void()> callable, bool selected = false, String command = "");
void updateStatusBar();
void battery(bool initial = false);
void battery2(bool initial = false);
void showMenuList(Menu* menu, int layer);
@@ -192,11 +191,14 @@ class MenuFunctions
uint16_t x = -1, y = -1;
boolean pressed = false;
bool disable_touch;
String loaded_file = "";
void initLVGL();
void deinitLVGL();
void selectEPHTMLGFX();
void updateStatusBar();
void addSSIDGFX();
void addAPGFX();
void addStationGFX();

View File

@@ -387,6 +387,22 @@ void loop()
mini = true;
#endif
#ifdef HAS_ILI9341
#ifdef HAS_BUTTONS
if (c_btn.isHeld()) {
if (menu_function_obj.disable_touch)
menu_function_obj.disable_touch = false;
else
menu_function_obj.disable_touch = true;
menu_function_obj.updateStatusBar();
while (!c_btn.justReleased())
delay(1);
}
#endif
#endif
// Update all of our objects
/*#ifdef HAS_SCREEN
bool do_draw = display_obj.draw_tft;

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

View File

@@ -0,0 +1,6 @@
#define ce2b329463664e43e1607d0384f46ac1NszJo7o8A3Pedgwr_width 16
#define ce2b329463664e43e1607d0384f46ac1NszJo7o8A3Pedgwr_height 16
static char ce2b329463664e43e1607d0384f46ac1NszJo7o8A3Pedgwr_bits[] = {
0xFF, 0xFF, 0xFD, 0xBF, 0x0B, 0xD0, 0xE7, 0xE7, 0xEF, 0xF7, 0xCF, 0xF3,
0xAF, 0xF5, 0x6F, 0xF6, 0x6F, 0xF6, 0xAF, 0xF5, 0xCF, 0xF3, 0x0F, 0xF0,
0xE7, 0xE7, 0x0B, 0xD0, 0xFD, 0xBF, 0xFF, 0xFF, };