mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2025-12-12 15:50:36 -08:00
Fix select ap menu for Marauder v7
This commit is contained in:
@@ -209,7 +209,13 @@ PROGMEM static const unsigned char menu_icons[][66] = {
|
||||
0xBB, 0x63, 0x38, 0x87, 0x3C, 0x3E, 0xFB, 0x0F, 0x3F, 0xFF, 0x81, 0x3F,
|
||||
0xFF, 0x3F, 0x38, 0xFF, 0xFF, 0x3C, 0xFF, 0x07, 0x3E, 0xFF, 0xEB, 0x3F,
|
||||
0xFF, 0xEF, 0x3F, 0xFF, 0xEF, 0x3F, 0xFF, 0xDF, 0x3F, 0xFF, 0xFF, 0x3F,
|
||||
0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F}
|
||||
0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F},
|
||||
{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // BLANK: 36
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}
|
||||
};
|
||||
|
||||
/*#ifndef MARAUDER_MINI
|
||||
|
||||
@@ -110,6 +110,14 @@ int8_t BatteryInterface::getBatteryLevel() {
|
||||
|
||||
|
||||
if (this->has_max17048) {
|
||||
return this->maxlipo.cellPercent();
|
||||
float percent = this->maxlipo.cellPercent();
|
||||
|
||||
// Sometimes we dumb
|
||||
if (percent >= 100)
|
||||
return 100;
|
||||
else if (percent <= 0)
|
||||
return 0;
|
||||
else
|
||||
return percent;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,8 +287,6 @@ void Display::displayBuffer(bool do_clear)
|
||||
{
|
||||
if (this->display_buffer->size() > 0)
|
||||
{
|
||||
delay(1);
|
||||
|
||||
while (display_buffer->size() > 0)
|
||||
{
|
||||
|
||||
|
||||
@@ -574,7 +574,7 @@ void MenuFunctions::buttonNotSelected(uint8_t b, int8_t x) {
|
||||
#ifdef HAS_FULL_SCREEN
|
||||
display_obj.tft.setFreeFont(MENU_FONT);
|
||||
display_obj.key[b].drawButton(false, current_menu->list->get(x).name);
|
||||
if (current_menu->list->get(x).name != text09)
|
||||
if ((current_menu->list->get(x).name != text09) && (current_menu->list->get(x).icon != 255))
|
||||
display_obj.tft.drawXBitmap(0,
|
||||
KEY_Y + x * (KEY_H + KEY_SPACING_Y) - (ICON_H / 2),
|
||||
menu_icons[current_menu->list->get(x).icon],
|
||||
@@ -599,7 +599,7 @@ void MenuFunctions::buttonSelected(uint8_t b, int8_t x) {
|
||||
#ifdef HAS_FULL_SCREEN
|
||||
display_obj.tft.setFreeFont(MENU_FONT);
|
||||
display_obj.key[b].drawButton(true, current_menu->list->get(x).name);
|
||||
if (current_menu->list->get(x).name != text09)
|
||||
if ((current_menu->list->get(x).name != text09) && (current_menu->list->get(x).icon != 255))
|
||||
display_obj.tft.drawXBitmap(0,
|
||||
KEY_Y + x * (KEY_H + KEY_SPACING_Y) - (ICON_H / 2),
|
||||
menu_icons[current_menu->list->get(x).icon],
|
||||
@@ -1769,18 +1769,24 @@ void MenuFunctions::RunSetup()
|
||||
});
|
||||
|
||||
// Select APs on Mini
|
||||
this->addNodes(&wifiGeneralMenu, text_table1[56], TFT_NAVY, NULL, KEYBOARD_ICO, [this](){
|
||||
this->addNodes(&wifiGeneralMenu, "Select APs", TFT_NAVY, NULL, KEYBOARD_ICO, [this](){
|
||||
// Add the back button
|
||||
wifiAPMenu.list->clear();
|
||||
this->addNodes(&wifiAPMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
this->changeMenu(wifiAPMenu.parentMenu);
|
||||
});
|
||||
|
||||
// Determine how big the whole menu is going to be
|
||||
int menu_limit;
|
||||
if (access_points->size() <= BUTTON_ARRAY_LEN)
|
||||
menu_limit = access_points->size();
|
||||
else
|
||||
menu_limit = BUTTON_ARRAY_LEN;
|
||||
|
||||
// Populate the menu with buttons
|
||||
for (int i = 0; i < menu_limit - 1; i++) {
|
||||
this->addNodes(&wifiAPMenu, access_points->get(i).essid, TFT_CYAN, NULL, KEYBOARD_ICO, [this, i](){
|
||||
// This is the menu node
|
||||
this->addNodes(&wifiAPMenu, access_points->get(i).essid, TFT_CYAN, NULL, 255, [this, i](){
|
||||
AccessPoint new_ap = access_points->get(i);
|
||||
new_ap.selected = !access_points->get(i).selected;
|
||||
|
||||
@@ -2630,18 +2636,18 @@ void MenuFunctions::displayCurrentMenu(uint8_t start_index)
|
||||
#ifdef HAS_FULL_SCREEN
|
||||
#ifndef HAS_ILI9341
|
||||
if ((current_menu->list->get(i).selected) || (current_menu->selected == i)) {
|
||||
display_obj.key[i].drawButton(true, current_menu->list->get(i).name);
|
||||
display_obj.key[i - start_index].drawButton(true, current_menu->list->get(i).name);
|
||||
}
|
||||
else {
|
||||
display_obj.key[i].drawButton(false, current_menu->list->get(i).name);
|
||||
display_obj.key[i - start_index].drawButton(false, current_menu->list->get(i).name);
|
||||
}
|
||||
#else
|
||||
display_obj.key[i].drawButton(false, current_menu->list->get(i).name);
|
||||
#endif
|
||||
|
||||
if (current_menu->list->get(i).name != text09)
|
||||
if ((current_menu->list->get(i).name != text09) && (current_menu->list->get(i).icon != 255))
|
||||
display_obj.tft.drawXBitmap(0,
|
||||
KEY_Y + i * (KEY_H + KEY_SPACING_Y) - (ICON_H / 2),
|
||||
KEY_Y + (i - start_index) * (KEY_H + KEY_SPACING_Y) - (ICON_H / 2),
|
||||
menu_icons[current_menu->list->get(i).icon],
|
||||
ICON_W,
|
||||
ICON_H,
|
||||
|
||||
@@ -73,6 +73,7 @@ extern Settings settings_obj;
|
||||
#define GPS_MENU 33
|
||||
#define DISABLE_TOUCH 34
|
||||
#define FLIPPER 35
|
||||
#define BLANK 36
|
||||
|
||||
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);
|
||||
|
||||
@@ -3040,7 +3040,7 @@ void WiFiScan::apSnifferCallbackFull(void* buf, wifi_promiscuous_pkt_type_t type
|
||||
|
||||
if (!in_list) {
|
||||
|
||||
delay(random(0, 10));
|
||||
//delay(random(0, 10));
|
||||
Serial.print("RSSI: ");
|
||||
Serial.print(snifferPacket->rx_ctrl.rssi);
|
||||
Serial.print(" Ch: ");
|
||||
@@ -3086,12 +3086,12 @@ void WiFiScan::apSnifferCallbackFull(void* buf, wifi_promiscuous_pkt_type_t type
|
||||
Serial.print(" ");
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
if (display_obj.display_buffer->size() == 0)
|
||||
{
|
||||
display_obj.loading = true;
|
||||
display_obj.display_buffer->add(display_string);
|
||||
display_obj.loading = false;
|
||||
}
|
||||
//if (display_obj.display_buffer->size() == 0)
|
||||
//{
|
||||
//display_obj.loading = true;
|
||||
display_obj.display_buffer->add(display_string);
|
||||
//display_obj.loading = false;
|
||||
//}
|
||||
#endif
|
||||
|
||||
if (essid == "") {
|
||||
@@ -3246,12 +3246,12 @@ void WiFiScan::apSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
|
||||
Serial.print(" ");
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
if (display_obj.display_buffer->size() == 0)
|
||||
{
|
||||
display_obj.loading = true;
|
||||
display_obj.display_buffer->add(display_string);
|
||||
display_obj.loading = false;
|
||||
}
|
||||
//if (display_obj.display_buffer->size() == 0)
|
||||
//{
|
||||
// display_obj.loading = true;
|
||||
display_obj.display_buffer->add(display_string);
|
||||
// display_obj.loading = false;
|
||||
//}
|
||||
#endif
|
||||
|
||||
if (essid == "") {
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
//#define MARAUDER_MINI
|
||||
//#define MARAUDER_V4
|
||||
//#define MARAUDER_V6
|
||||
#define MARAUDER_V6_1
|
||||
//#define MARAUDER_V7
|
||||
//#define MARAUDER_V6_1
|
||||
#define MARAUDER_V7
|
||||
//#define MARAUDER_KIT
|
||||
//#define GENERIC_ESP32
|
||||
//#define MARAUDER_FLIPPER
|
||||
@@ -22,7 +22,7 @@
|
||||
//#define MARAUDER_REV_FEATHER
|
||||
//// END BOARD TARGETS
|
||||
|
||||
#define MARAUDER_VERSION "v1.2.0"
|
||||
#define MARAUDER_VERSION "v1.2.1"
|
||||
|
||||
//// HARDWARE NAMES
|
||||
#ifdef MARAUDER_M5STICKC
|
||||
|
||||
Reference in New Issue
Block a user