mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2026-07-30 23:50:26 -07:00
Refactor Code + XIAO-ESP32-S3 Support
Refactoring / pre-processor optimizations to only include files if specified in the `configs.h` file. Also adds support for the XIAO-ESP32-S3 small board from Seeed Studio.
This commit is contained in:
@@ -5,7 +5,6 @@ BatteryInterface::BatteryInterface() {
|
||||
}
|
||||
|
||||
void BatteryInterface::main(uint32_t currentTime) {
|
||||
#ifndef MARAUDER_FLIPPER || XIAO_ESP32_S3
|
||||
if (currentTime != 0) {
|
||||
if (currentTime - initTime >= 3000) {
|
||||
//Serial.println("Checking Battery Level");
|
||||
@@ -18,18 +17,14 @@ void BatteryInterface::main(uint32_t currentTime) {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void BatteryInterface::RunSetup() {
|
||||
#ifndef MARAUDER_FLIPPER || XIAO_ESP32_S3
|
||||
Wire.begin(I2C_SDA, I2C_SCL);
|
||||
this->initTime = millis();
|
||||
#endif
|
||||
}
|
||||
|
||||
int8_t BatteryInterface::getBatteryLevel() {
|
||||
#ifndef MARAUDER_FLIPPER || XIAO_ESP32_S3
|
||||
Wire.beginTransmission(IP5306_ADDR);
|
||||
Wire.write(0x78);
|
||||
if (Wire.endTransmission(false) == 0 &&
|
||||
@@ -45,5 +40,4 @@ int8_t BatteryInterface::getBatteryLevel() {
|
||||
}
|
||||
this->i2c_supported = false;
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -5,9 +5,7 @@
|
||||
|
||||
#include "configs.h"
|
||||
|
||||
#ifndef MARAUDER_FLIPPER || XIAO_ESP32_S3
|
||||
#include <Wire.h>
|
||||
#endif
|
||||
|
||||
#define I2C_SDA 33
|
||||
#define I2C_SCL 22
|
||||
|
||||
@@ -270,12 +270,15 @@ void CommandLine::runCommand(String input) {
|
||||
#endif
|
||||
}
|
||||
// ls command
|
||||
#ifdef HAS_SD
|
||||
else if (cmd_args.get(0) == LS_CMD) {
|
||||
if (cmd_args.size() > 1)
|
||||
sd_obj.listDir(cmd_args.get(1));
|
||||
else
|
||||
Serial.println("You did not provide a dir to list");
|
||||
}
|
||||
#endif
|
||||
|
||||
// Channel command
|
||||
else if (cmd_args.get(0) == CH_CMD) {
|
||||
// Search for channel set arg
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
|
||||
#include "WiFiScan.h"
|
||||
#include "Web.h"
|
||||
#ifdef HAS_SD
|
||||
#include "SDInterface.h"
|
||||
#endif
|
||||
#include "settings.h"
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
@@ -20,12 +22,15 @@
|
||||
|
||||
extern WiFiScan wifi_scan_obj;
|
||||
extern Web web_obj;
|
||||
#ifdef HAS_SD
|
||||
extern SDInterface sd_obj;
|
||||
#endif
|
||||
extern Settings settings_obj;
|
||||
extern LinkedList<AccessPoint>* access_points;
|
||||
extern LinkedList<ssid>* ssids;
|
||||
extern LinkedList<Station>* stations;
|
||||
extern const String PROGMEM version_number;
|
||||
extern const String PROGMEM board_target;
|
||||
|
||||
//// Commands
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#ifdef HAS_SD
|
||||
|
||||
#include "SDInterface.h"
|
||||
#include "lang_var.h"
|
||||
|
||||
@@ -252,3 +254,5 @@ void SDInterface::main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -19,10 +19,7 @@ void TemperatureInterface::RunSetup() {
|
||||
}
|
||||
|
||||
uint8_t TemperatureInterface::getCurrentTemp() {
|
||||
#ifndef MARAUDER_FLIPPER || XIAO_ESP32_S3
|
||||
return ((temprature_sens_read() - 32) / 1.8);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
void TemperatureInterface::main(uint32_t currentTime) {
|
||||
|
||||
@@ -404,6 +404,8 @@ void WiFiScan::startWiFiAttacks(uint8_t scan_mode, uint16_t color, String title_
|
||||
this->wifi_initialized = true;
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.attackLED();
|
||||
#elif defined(XIAO_ESP32_S3)
|
||||
xiao_led.attackLED();
|
||||
#else
|
||||
led_obj.setMode(MODE_ATTACK);
|
||||
#endif
|
||||
@@ -425,6 +427,8 @@ bool WiFiScan::shutdownWiFi() {
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.offLED();
|
||||
#elif defined(XIAO_ESP32_S3)
|
||||
xiao_led.offLED();
|
||||
#else
|
||||
led_obj.setMode(MODE_OFF);
|
||||
#endif
|
||||
@@ -447,6 +451,8 @@ bool WiFiScan::shutdownBLE() {
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.offLED();
|
||||
#elif defined(XIAO_ESP32_S3)
|
||||
xiao_led.offLED();
|
||||
#else
|
||||
led_obj.setMode(MODE_OFF);
|
||||
#endif
|
||||
@@ -580,6 +586,8 @@ void WiFiScan::RunAPScan(uint8_t scan_mode, uint16_t color)
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.sniffLED();
|
||||
#elif defined(XIAO_ESP32_S3)
|
||||
xiao_led.sniffLED();
|
||||
#else
|
||||
led_obj.setMode(MODE_SNIFF);
|
||||
#endif
|
||||
@@ -817,7 +825,7 @@ void WiFiScan::RunInfo()
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_BATTERY
|
||||
battery_obj.battery_level = battery_obj.getBatteryLevel();
|
||||
if (battery_obj.i2c_supported) {
|
||||
#ifdef HAS_SCREEN
|
||||
@@ -830,6 +838,7 @@ void WiFiScan::RunInfo()
|
||||
display_obj.tft.println(text_table4[34]);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println(text_table4[35] + (String)temp_obj.current_temp + " C");
|
||||
@@ -845,6 +854,8 @@ void WiFiScan::RunEspressifScan(uint8_t scan_mode, uint16_t color) {
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.sniffLED();
|
||||
#elif defined(XIAO_ESP32_S3)
|
||||
xiao_led.sniffLED();
|
||||
#else
|
||||
led_obj.setMode(MODE_SNIFF);
|
||||
#endif
|
||||
@@ -882,6 +893,8 @@ void WiFiScan::RunPacketMonitor(uint8_t scan_mode, uint16_t color)
|
||||
{
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.sniffLED();
|
||||
#elif defined(XIAO_ESP32_S3)
|
||||
xiao_led.sniffLED();
|
||||
#else
|
||||
led_obj.setMode(MODE_SNIFF);
|
||||
#endif
|
||||
@@ -961,6 +974,8 @@ void WiFiScan::RunEapolScan(uint8_t scan_mode, uint16_t color)
|
||||
{
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.sniffLED();
|
||||
#elif defined(XIAO_ESP32_S3)
|
||||
xiao_led.sniffLED();
|
||||
#else
|
||||
led_obj.setMode(MODE_SNIFF);
|
||||
#endif
|
||||
@@ -1110,6 +1125,8 @@ void WiFiScan::RunPwnScan(uint8_t scan_mode, uint16_t color)
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.sniffLED();
|
||||
#elif defined(XIAO_ESP32_S3)
|
||||
xiao_led.sniffLED();
|
||||
#else
|
||||
led_obj.setMode(MODE_SNIFF);
|
||||
#endif
|
||||
@@ -1154,6 +1171,8 @@ void WiFiScan::RunBeaconScan(uint8_t scan_mode, uint16_t color)
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.sniffLED();
|
||||
#elif defined(XIAO_ESP32_S3)
|
||||
xiao_led.sniffLED();
|
||||
#else
|
||||
led_obj.setMode(MODE_SNIFF);
|
||||
#endif
|
||||
@@ -1197,6 +1216,8 @@ void WiFiScan::RunStationScan(uint8_t scan_mode, uint16_t color)
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.sniffLED();
|
||||
#elif defined(XIAO_ESP32_S3)
|
||||
xiao_led.sniffLED();
|
||||
#else
|
||||
led_obj.setMode(MODE_SNIFF);
|
||||
#endif
|
||||
@@ -1241,6 +1262,8 @@ void WiFiScan::RunRawScan(uint8_t scan_mode, uint16_t color)
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.sniffLED();
|
||||
#elif defined(XIAO_ESP32_S3)
|
||||
xiao_led.sniffLED();
|
||||
#else
|
||||
led_obj.setMode(MODE_SNIFF);
|
||||
#endif
|
||||
@@ -1287,6 +1310,8 @@ void WiFiScan::RunDeauthScan(uint8_t scan_mode, uint16_t color)
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.sniffLED();
|
||||
#elif defined(XIAO_ESP32_S3)
|
||||
xiao_led.sniffLED();
|
||||
#else
|
||||
led_obj.setMode(MODE_SNIFF);
|
||||
#endif
|
||||
@@ -1332,6 +1357,8 @@ void WiFiScan::RunProbeScan(uint8_t scan_mode, uint16_t color)
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.sniffLED();
|
||||
#elif defined(XIAO_ESP32_S3)
|
||||
xiao_led.sniffLED();
|
||||
#else
|
||||
led_obj.setMode(MODE_SNIFF);
|
||||
#endif
|
||||
|
||||
@@ -24,14 +24,27 @@
|
||||
#ifdef HAS_SCREEN
|
||||
#include "Display.h"
|
||||
#endif
|
||||
#ifdef HAS_SD
|
||||
#include "SDInterface.h"
|
||||
#endif
|
||||
#include "Buffer.h"
|
||||
#ifdef HAS_BATTERY
|
||||
#include "BatteryInterface.h"
|
||||
#endif
|
||||
#ifdef HAS_TEMP_SENSOR
|
||||
#include "TemperatureInterface.h"
|
||||
#endif
|
||||
#include "settings.h"
|
||||
#include "Assets.h"
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
#include "flipperLED.h"
|
||||
#endif
|
||||
#ifdef XIAO_ESP32_S3
|
||||
#include "xiaoLED.h"
|
||||
#endif
|
||||
#ifndef MARAUDER_FLIPPER || XIAO_ESP32_S3
|
||||
#include "LedInterface.h"
|
||||
#endif
|
||||
//#include "MenuFunctions.h"
|
||||
|
||||
#define bad_list_length 3
|
||||
@@ -77,13 +90,24 @@
|
||||
#ifdef HAS_SCREEN
|
||||
extern Display display_obj;
|
||||
#endif
|
||||
#ifdef HAS_SD
|
||||
extern SDInterface sd_obj;
|
||||
#endif
|
||||
extern Buffer buffer_obj;
|
||||
#ifdef HAS_BATTERY
|
||||
extern BatteryInterface battery_obj;
|
||||
#endif
|
||||
#ifdef HAS_TEMP_SENSOR
|
||||
extern TemperatureInterface temp_obj;
|
||||
#endif
|
||||
extern Settings settings_obj;
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
extern flipperLED flipper_led;
|
||||
#elif defined(XIAO_ESP32_S3)
|
||||
extern xiaoLED xiao_led;
|
||||
#else
|
||||
extern LedInterface led_obj;
|
||||
#endif
|
||||
|
||||
esp_err_t esp_wifi_80211_tx(wifi_interface_t ifx, const void *buffer, int len, bool en_sys_seq);
|
||||
//int ieee80211_raw_frame_sanity_check(int32_t arg, int32_t arg2, int32_t arg3);
|
||||
|
||||
+172
-45
@@ -8,28 +8,168 @@
|
||||
//If not defined, will write packages to SD card if supported
|
||||
//#define WRITE_PACKETS_SERIAL
|
||||
|
||||
//// BOARD TARGETS
|
||||
//#define MARAUDER_M5STICKC
|
||||
//#define MARAUDER_MINI
|
||||
//#define MARAUDER_V4
|
||||
//#define MARAUDER_V6
|
||||
//#define MARAUDER_KIT
|
||||
//#define GENERIC_ESP32
|
||||
#define MARAUDER_FLIPPER
|
||||
//#define MARAUDER_FLIPPER
|
||||
//#define ESP32_LDDB
|
||||
//#define MARAUDER_DEV_BOARD_PRO
|
||||
//#define XIAO_ESP32_S3
|
||||
//// END BOARD TARGETS
|
||||
|
||||
#define MARAUDER_VERSION "v0.10.7"
|
||||
|
||||
//// BOARD FEATURES
|
||||
#ifdef MARAUDER_M5STICKC
|
||||
//#define FLIPPER_ZERO_HAT
|
||||
#define HAS_BATTERY
|
||||
#define HAS_BUTTONS
|
||||
//#define HAS_NEOPIXEL_LED
|
||||
#define HAS_PWR_MGMT
|
||||
#define HAS_SCREEN
|
||||
#define HAS_SD
|
||||
#define HAS_TEMP_SENSOR
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_MINI
|
||||
//#define FLIPPER_ZERO_HAT
|
||||
#define HAS_BATTERY
|
||||
#define HAS_BT
|
||||
#define HAS_BUTTONS
|
||||
//#define HAS_NEOPIXEL_LED
|
||||
//#define HAS_PWR_MGMT
|
||||
#define HAS_SCREEN
|
||||
#define HAS_SD
|
||||
#define HAS_TEMP_SENSOR
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_V4
|
||||
//#define FLIPPER_ZERO_HAT
|
||||
#define HAS_BATTERY
|
||||
#define HAS_BT
|
||||
#define HAS_BUTTONS
|
||||
//#define HAS_NEOPIXEL_LED
|
||||
//#define HAS_PWR_MGMT
|
||||
#define HAS_SCREEN
|
||||
#define HAS_SD
|
||||
#define HAS_TEMP_SENSOR
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_V6
|
||||
//#define FLIPPER_ZERO_HAT
|
||||
#define HAS_BATTERY
|
||||
#define HAS_BT
|
||||
#define HAS_BUTTONS
|
||||
//#define HAS_NEOPIXEL_LED
|
||||
//#define HAS_PWR_MGMT
|
||||
#define HAS_SCREEN
|
||||
#define HAS_SD
|
||||
#define HAS_TEMP_SENSOR
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_KIT
|
||||
//#define FLIPPER_ZERO_HAT
|
||||
#define HAS_BATTERY
|
||||
#define HAS_BT
|
||||
#define HAS_BUTTONS
|
||||
//#define HAS_NEOPIXEL_LED
|
||||
//#define HAS_PWR_MGMT
|
||||
#define HAS_SCREEN
|
||||
#define HAS_SD
|
||||
#define HAS_TEMP_SENSOR
|
||||
#endif
|
||||
|
||||
#ifdef GENERIC_ESP32
|
||||
//#define FLIPPER_ZERO_HAT
|
||||
//#define HAS_BATTERY
|
||||
#define HAS_BT
|
||||
//#define HAS_BUTTONS
|
||||
//#define HAS_NEOPIXEL_LED
|
||||
//#define HAS_PWR_MGMT
|
||||
//#define HAS_SCREEN
|
||||
//#define HAS_SD
|
||||
//#define HAS_TEMP_SENSOR
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
#define FLIPPER_ZERO_HAT
|
||||
//#define HAS_BATTERY
|
||||
//#define HAS_BT
|
||||
//#define HAS_BUTTONS
|
||||
//#define HAS_NEOPIXEL_LED
|
||||
//#define HAS_PWR_MGMT
|
||||
//#define HAS_SCREEN
|
||||
//#define HAS_SD
|
||||
//#define HAS_TEMP_SENSOR
|
||||
#endif
|
||||
|
||||
#ifdef ESP32_LDDB
|
||||
//#define FLIPPER_ZERO_HAT
|
||||
//#define HAS_BATTERY
|
||||
//#define HAS_BT
|
||||
//#define HAS_BUTTONS
|
||||
#define HAS_NEOPIXEL_LED
|
||||
//#define HAS_PWR_MGMT
|
||||
//#define HAS_SCREEN
|
||||
#define HAS_SD
|
||||
//#define HAS_TEMP_SENSOR
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_DEV_BOARD_PRO
|
||||
//#define FLIPPER_ZERO_HAT
|
||||
//#define HAS_BATTERY
|
||||
#define HAS_BT
|
||||
//#define HAS_BUTTONS
|
||||
//#define HAS_NEOPIXEL_LED
|
||||
//#define HAS_PWR_MGMT
|
||||
//#define HAS_SCREEN
|
||||
#define HAS_SD
|
||||
//#define HAS_TEMP_SENSOR
|
||||
#endif
|
||||
|
||||
#ifdef XIAO_ESP32_S3
|
||||
#define FLIPPER_ZERO_HAT
|
||||
//#define HAS_BATTERY
|
||||
#define HAS_BT
|
||||
//#define HAS_BUTTONS
|
||||
//#define HAS_NEOPIXEL_LED
|
||||
//#define HAS_PWR_MGMT
|
||||
//#define HAS_SCREEN
|
||||
//#define HAS_SD
|
||||
//#define HAS_TEMP_SENSOR
|
||||
#endif
|
||||
//// END BOARD FEATURES
|
||||
|
||||
//// FLIPPER ZERO HAT SETTINGS
|
||||
#ifdef FLIPPER_ZERO_HAT
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
#define USE_FLIPPER_SD
|
||||
#endif
|
||||
|
||||
#ifdef XIAO_ESP32_S3
|
||||
#define USE_FLIPPER_SD
|
||||
#endif
|
||||
|
||||
#endif
|
||||
//// END FLIPPER ZERO HAT SETTINGS
|
||||
|
||||
//// POWER MANAGEMENT
|
||||
#ifdef HAS_PWR_MGMT
|
||||
#ifdef MARAUDER_M5STICKC
|
||||
#include "AXP192.h"
|
||||
#endif
|
||||
#endif
|
||||
//// END POWER MANAGEMENT
|
||||
|
||||
//// BUTTON DEFINITIONS
|
||||
#ifdef MARAUDER_MINI
|
||||
#define HAS_BUTTONS
|
||||
#ifdef HAS_BUTTONS
|
||||
|
||||
#ifdef MARAUDER_MINI
|
||||
#define L_BTN 13
|
||||
#define C_BTN 34
|
||||
#define U_BTN 36
|
||||
@@ -38,8 +178,6 @@
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_M5STICKC
|
||||
#define HAS_BUTTONS
|
||||
|
||||
#define L_BTN -1
|
||||
#define C_BTN 37
|
||||
#define U_BTN -1
|
||||
@@ -47,11 +185,12 @@
|
||||
#define D_BTN 39
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_V4
|
||||
#endif
|
||||
//// END BUTTON DEFINITIONS
|
||||
|
||||
//// DISPLAY DEFINITIONS
|
||||
#ifdef HAS_SCREEN
|
||||
|
||||
#ifdef MARAUDER_M5STICKC
|
||||
//#define TFT_MISO 19
|
||||
#define TFT_MOSI 15
|
||||
@@ -350,6 +489,8 @@
|
||||
|
||||
#define STATUSBAR_COLOR 0x4A49
|
||||
#endif
|
||||
|
||||
#endif
|
||||
//// END DISPLAY DEFINITIONS
|
||||
|
||||
//// MENU DEFINITIONS
|
||||
@@ -448,6 +589,14 @@
|
||||
//// END MENU DEFINITIONS
|
||||
|
||||
//// SD DEFINITIONS
|
||||
#ifdef FLIPPER_ZERO_HAT
|
||||
|
||||
#ifdef USE_FLIPPER_SD
|
||||
#define WRITE_PACKETS_SERIAL
|
||||
#endif
|
||||
|
||||
#elif defined(USE_SD)
|
||||
|
||||
#ifdef MARAUDER_V4
|
||||
#define SD_CS 12
|
||||
#endif
|
||||
@@ -482,50 +631,14 @@
|
||||
|
||||
#ifdef XIAO_ESP32_S3
|
||||
#define SD_CS 3
|
||||
// Override RX1+TX1 pins
|
||||
#define XIAO_RX1 1
|
||||
#define XIAO_TX1 2
|
||||
#endif
|
||||
|
||||
#endif
|
||||
//// END SD DEFINITIONS
|
||||
|
||||
//// SCREEN STUFF
|
||||
#ifdef MARAUDER_DEV_BOARD_PRO
|
||||
#define HAS_BT
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_MINI
|
||||
#define HAS_SCREEN
|
||||
#define HAS_BT
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_M5STICKC
|
||||
#define HAS_SCREEN
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_V4
|
||||
#define HAS_SCREEN
|
||||
#define HAS_BT
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_V6
|
||||
#define HAS_SCREEN
|
||||
#define HAS_BT
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_KIT
|
||||
#define HAS_SCREEN
|
||||
#define HAS_BT
|
||||
#endif
|
||||
|
||||
#ifdef GENERIC_ESP32
|
||||
#define HAS_BT
|
||||
#endif
|
||||
|
||||
#ifdef XIAO_ESP32_S3
|
||||
#define HAS_BT
|
||||
#endif
|
||||
|
||||
#ifndef HAS_SCREEN
|
||||
|
||||
#define TFT_WHITE 0
|
||||
#define TFT_CYAN 0
|
||||
#define TFT_BLUE 0
|
||||
@@ -545,10 +658,13 @@
|
||||
#include <LinkedList.h>
|
||||
#include "SPIFFS.h"
|
||||
#include "Assets.h"
|
||||
|
||||
#endif
|
||||
//// END SCREEN STUFF
|
||||
|
||||
//// NEOPIXEL STUFF
|
||||
#ifdef HAS_NEOPIXEL_LED
|
||||
|
||||
#if defined(ESP32_LDDB)
|
||||
#define PIN 17
|
||||
#elif defined(MARAUDER_DEV_BOARD_PRO)
|
||||
@@ -557,5 +673,16 @@
|
||||
#define PIN 25
|
||||
#endif
|
||||
|
||||
#endif
|
||||
//// END NEOPIXEL STUFF
|
||||
|
||||
//// BOARD PIN OVERRIDES
|
||||
#ifdef XIAO_ESP32_S3
|
||||
#ifdef USE_FLIPPER_SD
|
||||
#define XIAO_RX1 1
|
||||
#define XIAO_TX1 2
|
||||
#endif
|
||||
#endif
|
||||
//// END BOARD PIN OVERRIDES
|
||||
|
||||
#endif
|
||||
@@ -24,18 +24,32 @@ https://www.online-utility.org/image/convert/to/XBM
|
||||
|
||||
#include "Assets.h"
|
||||
#include "WiFiScan.h"
|
||||
#ifdef HAS_SD
|
||||
#include "SDInterface.h"
|
||||
#endif
|
||||
#include "Web.h"
|
||||
#include "Buffer.h"
|
||||
#include "BatteryInterface.h"
|
||||
#include "TemperatureInterface.h"
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
#include "flipperLED.h"
|
||||
#elif defined(XIAO_ESP32_S3)
|
||||
#include "xiaoLED.h"
|
||||
#else
|
||||
#include "LedInterface.h"
|
||||
#endif
|
||||
|
||||
#include "esp_interface.h"
|
||||
#include "settings.h"
|
||||
#include "CommandLine.h"
|
||||
#include "lang_var.h"
|
||||
#include "flipperLED.h"
|
||||
#include "xiaoLED.h"
|
||||
|
||||
#ifdef HAS_BATTERY
|
||||
#include "BatteryInterface.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAS_TEMP_SENSOR
|
||||
#include "TemperatureInterface.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
#include "Display.h"
|
||||
@@ -65,17 +79,19 @@ https://www.online-utility.org/image/convert/to/XBM
|
||||
#endif
|
||||
|
||||
WiFiScan wifi_scan_obj;
|
||||
SDInterface sd_obj;
|
||||
Web web_obj;
|
||||
Buffer buffer_obj;
|
||||
BatteryInterface battery_obj;
|
||||
TemperatureInterface temp_obj;
|
||||
LedInterface led_obj;
|
||||
EspInterface esp_obj;
|
||||
Settings settings_obj;
|
||||
CommandLine cli_obj;
|
||||
flipperLED flipper_led;
|
||||
xiaoLED xiao_led;
|
||||
|
||||
#ifdef HAS_BATTERY
|
||||
BatteryInterface battery_obj;
|
||||
#endif
|
||||
|
||||
#ifdef HAS_TEMP_SENSOR
|
||||
TemperatureInterface temp_obj;
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
Display display_obj;
|
||||
@@ -83,13 +99,28 @@ xiaoLED xiao_led;
|
||||
A32u4Interface a32u4_obj;
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SD
|
||||
SDInterface sd_obj;
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_M5STICKC
|
||||
AXP192 axp192_obj;
|
||||
#endif
|
||||
|
||||
const String PROGMEM version_number = MARAUDER_VERSION;
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipperLED flipper_led;
|
||||
#elif defined(XIAO_ESP32_S3)
|
||||
xiaoLED xiao_led;
|
||||
#else
|
||||
LedInterface led_obj;
|
||||
#endif
|
||||
|
||||
const String PROGMEM version_number = MARAUDER_VERSION;
|
||||
const String PROGMEM board_target = MARAUDER_TARGET;
|
||||
|
||||
#ifdef HAS_NEOPIXEL_LED
|
||||
Adafruit_NeoPixel strip = Adafruit_NeoPixel(Pixels, PIN, NEO_GRB + NEO_KHZ800);
|
||||
#endif
|
||||
|
||||
uint32_t currentTime = 0;
|
||||
|
||||
@@ -142,6 +173,7 @@ void setup()
|
||||
digitalWrite(TFT_CS, HIGH);
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SD
|
||||
pinMode(SD_CS, OUTPUT);
|
||||
|
||||
delay(10);
|
||||
@@ -149,14 +181,21 @@ void setup()
|
||||
digitalWrite(SD_CS, HIGH);
|
||||
|
||||
delay(10);
|
||||
#endif
|
||||
|
||||
Serial.begin(115200);
|
||||
|
||||
#ifdef WRITE_PACKETS_SERIAL
|
||||
// Starts a second serial channel to stream the captured packets
|
||||
#ifdef WRITE_PACKETS_SERIAL
|
||||
|
||||
#ifdef XIAO_ESP32_S3
|
||||
Serial1.begin(115200, SERIAL_8N1, XIAO_RX1, XIAO_TX1);
|
||||
#else
|
||||
Serial1.begin(115200);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
//Serial.println("\n\nHello, World!\n");
|
||||
|
||||
Serial.println("ESP-IDF version is: " + String(esp_get_idf_version()));
|
||||
@@ -212,14 +251,6 @@ void setup()
|
||||
|
||||
settings_obj.begin();
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.RunSetup();
|
||||
#endif
|
||||
|
||||
#ifdef XIAO_ESP32_S3
|
||||
xiao_led.RunSetup();
|
||||
#endif
|
||||
|
||||
//Serial.println("This is a test Channel: " + (String)settings_obj.loadSetting<uint8_t>("Channel"));
|
||||
//if (settings_obj.loadSetting<bool>( "Force PMKID"))
|
||||
// Serial.println("This is a test Force PMKID: true");
|
||||
@@ -252,14 +283,16 @@ void setup()
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAS_BATTERY
|
||||
battery_obj.RunSetup();
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println(F(text_table0[5]));
|
||||
#endif
|
||||
|
||||
// Temperature stuff
|
||||
#ifndef MARAUDER_FLIPPER || XIAO_ESP32_S3
|
||||
#ifdef HAS_TEMP_SENSOR
|
||||
temp_obj.RunSetup();
|
||||
#endif
|
||||
|
||||
@@ -267,7 +300,7 @@ void setup()
|
||||
display_obj.tft.println(F(text_table0[6]));
|
||||
#endif
|
||||
|
||||
#ifndef MARAUDER_FLIPPER || XIAO_ESP32_S3
|
||||
#ifdef HAS_BATTERY
|
||||
battery_obj.battery_level = battery_obj.getBatteryLevel();
|
||||
|
||||
// if (battery_obj.i2c_supported) {
|
||||
@@ -278,7 +311,11 @@ void setup()
|
||||
#endif
|
||||
|
||||
// Do some LED stuff
|
||||
#ifndef MARAUDER_FLIPPER || XIAO_ESP32_S3
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.RunSetup();
|
||||
#elif defined(XIAO_ESP32_S3)
|
||||
xiao_led.RunSetup();
|
||||
#else
|
||||
led_obj.RunSetup();
|
||||
#endif
|
||||
|
||||
@@ -341,7 +378,7 @@ void loop()
|
||||
sd_obj.main();
|
||||
#endif
|
||||
|
||||
#ifndef MARAUDER_FLIPPER || XIAO_ESP32_S3
|
||||
#ifdef HAS_BATTERY
|
||||
battery_obj.main(currentTime);
|
||||
temp_obj.main(currentTime);
|
||||
#endif
|
||||
@@ -353,9 +390,14 @@ void loop()
|
||||
#endif
|
||||
//cli_obj.main(currentTime);
|
||||
}
|
||||
#ifndef MARAUDER_FLIPPER || XIAO_ESP32_S3
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.main();
|
||||
#elif defined(XIAO_ESP32_S3)
|
||||
xiao_led.main();
|
||||
#else
|
||||
led_obj.main(currentTime);
|
||||
#endif
|
||||
|
||||
if (wifi_scan_obj.currentScanMode == OTA_UPDATE)
|
||||
web_obj.main();
|
||||
#ifdef HAS_SCREEN
|
||||
@@ -376,9 +418,15 @@ void loop()
|
||||
display_obj.main(wifi_scan_obj.currentScanMode);
|
||||
menu_function_obj.main(currentTime);
|
||||
#endif
|
||||
#ifndef MARAUDER_FLIPPER || XIAO_ESP32_S3
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.main();
|
||||
#elif defined(XIAO_ESP32_S3)
|
||||
xiao_led.main();
|
||||
#else
|
||||
led_obj.main(currentTime);
|
||||
#endif
|
||||
|
||||
//cli_obj.main(currentTime);
|
||||
delay(1);
|
||||
}
|
||||
|
||||
@@ -55,3 +55,7 @@ void flipperLED::offLED() {
|
||||
digitalWrite(G_PIN, HIGH);
|
||||
digitalWrite(R_PIN, HIGH);
|
||||
}
|
||||
|
||||
void flipperLED::main() {
|
||||
// do nothing
|
||||
}
|
||||
@@ -16,6 +16,7 @@ class flipperLED {
|
||||
|
||||
public:
|
||||
void RunSetup();
|
||||
void main();
|
||||
void attackLED();
|
||||
void sniffLED();
|
||||
void offLED();
|
||||
|
||||
@@ -13,9 +13,11 @@ delay(50);
|
||||
digitalWrite(XIAO_LED_PIN, LOW);
|
||||
delay(500);
|
||||
digitalWrite(XIAO_LED_PIN, HIGH);
|
||||
delay(250);
|
||||
digitalWrite(XIAO_LED_PIN, LOW);
|
||||
delay(500);
|
||||
digitalWrite(XIAO_LED_PIN, HIGH);
|
||||
delay(250);
|
||||
digitalWrite(XIAO_LED_PIN, LOW);
|
||||
delay(500);
|
||||
digitalWrite(XIAO_LED_PIN, HIGH);
|
||||
@@ -26,7 +28,7 @@ void xiaoLED::attackLED() {
|
||||
return;
|
||||
|
||||
digitalWrite(XIAO_LED_PIN, HIGH);
|
||||
delay(10);
|
||||
delay(300);
|
||||
digitalWrite(XIAO_LED_PIN, LOW);
|
||||
}
|
||||
|
||||
@@ -35,7 +37,7 @@ void xiaoLED::sniffLED() {
|
||||
return;
|
||||
|
||||
digitalWrite(XIAO_LED_PIN, HIGH);
|
||||
delay(10);
|
||||
delay(300);
|
||||
digitalWrite(XIAO_LED_PIN, LOW);
|
||||
}
|
||||
|
||||
@@ -45,3 +47,7 @@ void xiaoLED::offLED() {
|
||||
|
||||
digitalWrite(XIAO_LED_PIN, HIGH);
|
||||
}
|
||||
|
||||
void xiaoLED::main() {
|
||||
// do nothing
|
||||
}
|
||||
@@ -14,6 +14,7 @@ class xiaoLED {
|
||||
|
||||
public:
|
||||
void RunSetup();
|
||||
void main();
|
||||
void attackLED();
|
||||
void sniffLED();
|
||||
void offLED();
|
||||
|
||||
Reference in New Issue
Block a user