This commit is contained in:
Just Call Me Koko
2020-03-21 20:20:25 -04:00
parent a2fa6759a8
commit ca4048983f
8 changed files with 24 additions and 124 deletions

View File

@@ -14,7 +14,7 @@ https://www.online-utility.org/image/convert/to/XBM
#include "freertos/task.h"
#include "esp_system.h"
#include <Arduino.h>
#include <Preferences.h>
//#include <Preferences.h>
#include "Assets.h"
@@ -24,7 +24,7 @@ https://www.online-utility.org/image/convert/to/XBM
#include "SDInterface.h"
#include "Web.h"
#include "Buffer.h"
#include "BatteryInterface.h"
//#include "BatteryInterface.h"
//#include "icons.h"
Display display_obj;
@@ -33,57 +33,26 @@ MenuFunctions menu_function_obj;
SDInterface sd_obj;
Web web_obj;
Buffer buffer_obj;
BatteryInterface battery_obj;
//BatteryInterface battery_obj;
Preferences preferences;
//Preferences preferences;
uint32_t currentTime = 0;
void setup()
{
Serial.begin(115200);
Serial.println("\n\n-------------------------------------\n");
//Serial.println("\n\n-------------------------------------\n");
pinMode(FLASH_BUTTON, INPUT);
pinMode(TFT_BL, OUTPUT);
digitalWrite(TFT_BL, LOW);
preferences.begin("my-app", false);
unsigned int counter = preferences.getUInt("counter", 0);
if (counter == 0) {
counter++;
// Print the counter to Serial Monitor
Serial.printf("Current counter value: %u\n", counter);
// Store the counter to the Preferences
preferences.putUInt("counter", counter);
// Close the Preferences
preferences.end();
Serial.println("Initial reboot...");
ESP.restart();
}
else {
Serial.println("Initial reboot complete");
counter = 0;
// Print the counter to Serial Monitor
Serial.printf("Current counter value: %u\n", counter);
// Store the counter to the Preferences
preferences.putUInt("counter", counter);
// Close the Preferences
preferences.end();
}
// Preset SPI CS pins to avoid bus conflicts
digitalWrite(TFT_CS, HIGH);
digitalWrite(SD_CS, HIGH);
Serial.begin(115200);
Serial.println("\n\n--------------------------------\n");
Serial.println(" ESP32 Marauder \n");
@@ -102,16 +71,6 @@ void setup()
// Build menus
menu_function_obj.RunSetup();
battery_obj.RunSetup();
battery_obj.battery_level = battery_obj.getBatteryLevel();
if (battery_obj.i2c_supported) {
Serial.println("IP5306 I2C Supported: true");
}
else
Serial.println("IP5306 I2C Supported: false");
}
@@ -129,7 +88,7 @@ void loop()
{
display_obj.main();
wifi_scan_obj.main(currentTime);
sd_obj.main(currentTime);
sd_obj.main();
//if ((wifi_scan_obj.currentScanMode != WIFI_ATTACK_BEACON_SPAM))
if ((wifi_scan_obj.currentScanMode != WIFI_PACKET_MONITOR) &&
(wifi_scan_obj.currentScanMode != WIFI_SCAN_EAPOL))