* Update Display.cpp

I THINK I FIGURED OUT WHAT IM DOING

* Add files via upload

* Update esp32_marauder.ino

* Update MenuFunctions.cpp

* Update MenuFunctions.h

* Update MenuFunctions.cpp

* Update README.md

* Update README.md

* Update MenuFunctions.cpp

* Update MenuFunctions.h

* Update MenuFunctions.h

* Add files via upload

* Update esp32_marauder.ino

* Update README.md

* Update Display.cpp

moved the float "wd", as the draw function would continously change it, which resulted in those weird effects when trying to draw different thicknesses

* Update MenuFunctions.cpp

* Update Display.cpp

made it so the drawing code doesnt need to draw every pixel individually and made it so it can handle higher thiccnesses... at all. it did not handly thicknesses above 2 with any kind of grace

* Update Display.cpp

removed unneccessary variable changes, just realized i kept making certain variables be a certain value over and over

* Fix screen change battery percentage

* restore TFT touch data

Co-authored-by: Just Call Me Koko <25190487+justcallmekoko@users.noreply.github.com>
This commit is contained in:
Joshinken
2020-07-21 23:45:20 +02:00
committed by GitHub
parent bbc10e4452
commit 7a5134bb86
6 changed files with 834 additions and 624 deletions

View File

@@ -1,12 +1,15 @@
#ifndef MenuFunctions_h
#define MenuFunctions_h
#define BATTERY_ANALOG_ON 0
#include "WiFiScan.h"
#include "Display.h"
#include "BatteryInterface.h"
#include "SDInterface.h"
#include "Web.h"
extern Display display_obj;
extern WiFiScan wifi_scan_obj;
extern Web web_obj;
@@ -28,6 +31,12 @@ extern BatteryInterface battery_obj;
#define FLASH_BUTTON 0
#if BATTERY_ANALOG_ON == 1
#define BATTERY_PIN 13
#define ANALOG_PIN 34
#define CHARGING_PIN 27
#endif
// Icon definitions
#define ATTACKS 0
#define BEACON_SNIFF 1
@@ -61,35 +70,35 @@ struct Menu;
// Individual Nodes of a menu
struct MenuNode {
String name;
uint16_t color;
int icon;
TFT_eSPI_Button* button;
std::function<void()> callable;
String name;
uint16_t color;
int icon;
TFT_eSPI_Button* button;
std::function<void()> callable;
};
// Full Menus
struct Menu {
String name;
LinkedList<MenuNode>* list;
Menu * parentMenu;
//uint8_t selected;
String name;
LinkedList<MenuNode>* list;
Menu * parentMenu;
//uint8_t selected;
};
class MenuFunctions
{
private:
private:
String u_result = "";
uint32_t initTime = 0;
Menu* current_menu;
// Main menu stuff
Menu mainMenu;
Menu wifiMenu;
Menu bluetoothMenu;
Menu generalMenu;
@@ -112,17 +121,19 @@ class MenuFunctions
Menu bluetoothScannerMenu;
// Menu icons
//TFT_eSPI_Button key[BUTTON_ARRAY_LEN];
void addNodes(Menu* menu, String name, uint16_t color, Menu* child, int place, std::function<void()> callable);
void drawStatusBar();
void updateStatusBar();
void battery(bool initial = false);
void battery2(bool initial = false);
void showMenuList(Menu* menu, int layer);
void orientDisplay();
public:
public:
MenuFunctions();
uint16_t x = -1, y = -1;