Просмотр исходного кода

Fix crash during packet sniff

Replace SimpleList with LinkedList
Just Call Me Koko 6 лет назад
Родитель
Сommit
e8e1686918

+ 1 - 1
esp32_marauder/Display.cpp

@@ -17,7 +17,7 @@ void Display::RunSetup()
   run_setup = false;
 
   // Need to declare new
-  display_buffer = new SimpleList<String>();
+  display_buffer = new LinkedList<String>();
   
   tft.init();
   tft.setRotation(0); // Portrait

+ 4 - 3
esp32_marauder/Display.h

@@ -5,7 +5,8 @@
 #include <FS.h>
 #include <functional>
 #include <JPEGDecoder.h>
-#include <SimpleList.h>
+//#include <SimpleList.h>
+#include <LinkedList.h>
 #include <SPI.h>
 #include "SPIFFS.h"
 
@@ -52,7 +53,7 @@ class Display
     TFT_eSPI tft = TFT_eSPI();
     TFT_eSprite img = TFT_eSprite(&tft);
     TFT_eSPI_Button key[BUTTON_ARRAY_LEN];
-    String version_number = "v0.4.1";
+    String version_number = "v0.4.2";
 
     bool printing = false;
     bool loading = false;
@@ -69,7 +70,7 @@ class Display
     //Menu wifiMenu;
     //Menu bluetoothMenu;
 
-    SimpleList<String>* display_buffer;
+    LinkedList<String>* display_buffer;
 
     // The initial y coordinate of the top of the bottom text line
     uint16_t yDraw = YMAX - BOT_FIXED_AREA - TEXT_HEIGHT;

+ 10 - 10
esp32_marauder/MenuFunctions.cpp

@@ -241,22 +241,22 @@ void MenuFunctions::orientDisplay()
 void MenuFunctions::RunSetup()
 {
   // root menu stuff
-  mainMenu.list = new SimpleList<MenuNode>(); // Get list in first menu ready
+  mainMenu.list = new LinkedList<MenuNode>(); // Get list in first menu ready
 
   // Main menu stuff
-  wifiMenu.list = new SimpleList<MenuNode>(); // Get list in second menu ready
-  bluetoothMenu.list = new SimpleList<MenuNode>(); // Get list in third menu ready
-  generalMenu.list = new SimpleList<MenuNode>();
-  updateMenu.list = new SimpleList<MenuNode>();
+  wifiMenu.list = new LinkedList<MenuNode>(); // Get list in second menu ready
+  bluetoothMenu.list = new LinkedList<MenuNode>(); // Get list in third menu ready
+  generalMenu.list = new LinkedList<MenuNode>();
+  updateMenu.list = new LinkedList<MenuNode>();
 
   // WiFi menu stuff
-  wifiSnifferMenu.list = new SimpleList<MenuNode>();
-  wifiScannerMenu.list = new SimpleList<MenuNode>();
-  wifiAttackMenu.list = new SimpleList<MenuNode>();
+  wifiSnifferMenu.list = new LinkedList<MenuNode>();
+  wifiScannerMenu.list = new LinkedList<MenuNode>();
+  wifiAttackMenu.list = new LinkedList<MenuNode>();
 
   // Bluetooth menu stuff
-  bluetoothSnifferMenu.list = new SimpleList<MenuNode>();
-  bluetoothScannerMenu.list = new SimpleList<MenuNode>();
+  bluetoothSnifferMenu.list = new LinkedList<MenuNode>();
+  bluetoothScannerMenu.list = new LinkedList<MenuNode>();
 
   // Work menu names
   mainMenu.name = " ESP32 Marauder ";

+ 1 - 1
esp32_marauder/MenuFunctions.h

@@ -58,7 +58,7 @@ struct MenuNode {
 // Full Menus
 struct Menu {
     String name;
-    SimpleList<MenuNode>* list;
+    LinkedList<MenuNode>* list;
     Menu                * parentMenu;
     uint8_t               selected;
 };