Procházet zdrojové kódy

Fix crash with too many APs on menu

Just Call Me Koko před 3 roky
rodič
revize
7e37ef933e
2 změnil soubory, kde provedl 9 přidání a 4 odebrání
  1. 6 1
      esp32_marauder/MenuFunctions.cpp
  2. 3 3
      esp32_marauder/configs.h

+ 6 - 1
esp32_marauder/MenuFunctions.cpp

@@ -1674,7 +1674,12 @@ void MenuFunctions::RunSetup()
         addNodes(&wifiAPMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
         changeMenu(wifiAPMenu.parentMenu);
       });
-      for (int i = 0; i < access_points->size(); i++) {
+      int menu_limit;
+      if (access_points->size() <= BUTTON_ARRAY_LEN)
+        menu_limit = access_points->size();
+      else
+        menu_limit = BUTTON_ARRAY_LEN;
+      for (int i = 0; i < menu_limit - 1; i++) {
         addNodes(&wifiAPMenu, access_points->get(i).essid, TFT_CYAN, NULL, KEYBOARD_ICO, [this, i](){
         AccessPoint new_ap = access_points->get(i);
         new_ap.selected = !access_points->get(i).selected;

+ 3 - 3
esp32_marauder/configs.h

@@ -5,13 +5,13 @@
   #define POLISH_POTATO
   
   //#define MARAUDER_MINI
-  #define MARAUDER_V4
+  //#define MARAUDER_V4
   //#define MARAUDER_V6
   //#define MARAUDER_KIT
   //#define GENERIC_ESP32
-  //#define MARAUDER_FLIPPER
+  #define MARAUDER_FLIPPER
 
-  #define MARAUDER_VERSION "v0.9.17"
+  #define MARAUDER_VERSION "v0.9.18"
 
   //// BUTTON DEFINITIONS
   #ifdef MARAUDER_MINI