mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2025-12-05 20:40:25 -08:00
Fix num sats on status bar
This commit is contained in:
@@ -34,10 +34,6 @@ void GpsInterface::begin() {
|
|||||||
|
|
||||||
delay(3900);
|
delay(3900);
|
||||||
|
|
||||||
MicroNMEA::sendSentence(Serial2, "$PSTMFORCESTANDBY,00006");
|
|
||||||
|
|
||||||
delay(100);
|
|
||||||
|
|
||||||
if (Serial2.available()) {
|
if (Serial2.available()) {
|
||||||
Serial.println("GPS Attached Successfully");
|
Serial.println("GPS Attached Successfully");
|
||||||
this->gps_enabled = true;
|
this->gps_enabled = true;
|
||||||
@@ -46,10 +42,8 @@ void GpsInterface::begin() {
|
|||||||
char c = Serial2.read();
|
char c = Serial2.read();
|
||||||
//Serial.print(c);
|
//Serial.print(c);
|
||||||
//Pass the character to the library
|
//Pass the character to the library
|
||||||
Serial.print(c);
|
|
||||||
nmea.process(c);
|
nmea.process(c);
|
||||||
}
|
}
|
||||||
Serial.println(nmea.getSentence());
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this->gps_enabled = false;
|
this->gps_enabled = false;
|
||||||
@@ -536,6 +530,10 @@ String GpsInterface::getNumSatsString() {
|
|||||||
return (String)num_sats;
|
return (String)num_sats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int GpsInterface::getNumSats() {
|
||||||
|
return num_sats;
|
||||||
|
}
|
||||||
|
|
||||||
bool GpsInterface::getFixStatus() {
|
bool GpsInterface::getFixStatus() {
|
||||||
return this->good_fix;
|
return this->good_fix;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ class GpsInterface {
|
|||||||
void begin();
|
void begin();
|
||||||
void main();
|
void main();
|
||||||
|
|
||||||
|
int getNumSats();
|
||||||
String getNumSatsString();
|
String getNumSatsString();
|
||||||
bool getFixStatus();
|
bool getFixStatus();
|
||||||
String getFixStatusAsString();
|
String getFixStatusAsString();
|
||||||
|
|||||||
@@ -934,6 +934,11 @@ void MenuFunctions::updateStatusBar()
|
|||||||
|
|
||||||
uint16_t the_color;
|
uint16_t the_color;
|
||||||
|
|
||||||
|
if (this->old_gps_sat_count != gps_obj.getNumSats()) {
|
||||||
|
this->old_gps_sat_count = gps_obj.getNumSats();
|
||||||
|
display_obj.tft.fillRect(0, 0, 240, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
||||||
|
}
|
||||||
|
|
||||||
// GPS Stuff
|
// GPS Stuff
|
||||||
#ifdef HAS_GPS
|
#ifdef HAS_GPS
|
||||||
if (gps_obj.getGpsModuleStatus()) {
|
if (gps_obj.getGpsModuleStatus()) {
|
||||||
@@ -1292,8 +1297,10 @@ void MenuFunctions::RunSetup()
|
|||||||
#if (!defined(HAS_ILI9341) && defined(HAS_BUTTONS))
|
#if (!defined(HAS_ILI9341) && defined(HAS_BUTTONS))
|
||||||
miniKbMenu.name = "Mini Keyboard";
|
miniKbMenu.name = "Mini Keyboard";
|
||||||
#endif
|
#endif
|
||||||
#ifndef HAS_ILI9341
|
#ifdef HAS_SD
|
||||||
sdDeleteMenu.name = "Delete SD Files";
|
#ifndef HAS_ILI9341
|
||||||
|
sdDeleteMenu.name = "Delete SD Files";
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Build Main Menu
|
// Build Main Menu
|
||||||
@@ -1719,6 +1726,7 @@ void MenuFunctions::RunSetup()
|
|||||||
this->addNodes(&deviceMenu, text08, TFT_NAVY, NULL, KEYBOARD_ICO, [this]() {
|
this->addNodes(&deviceMenu, text08, TFT_NAVY, NULL, KEYBOARD_ICO, [this]() {
|
||||||
this->changeMenu(&settingsMenu);
|
this->changeMenu(&settingsMenu);
|
||||||
});
|
});
|
||||||
|
|
||||||
#ifdef HAS_SD
|
#ifdef HAS_SD
|
||||||
if (sd_obj.supported) {
|
if (sd_obj.supported) {
|
||||||
this->addNodes(&deviceMenu, "Delete SD Files", TFT_CYAN, NULL, SD_UPDATE, [this]() {
|
this->addNodes(&deviceMenu, "Delete SD Files", TFT_CYAN, NULL, SD_UPDATE, [this]() {
|
||||||
@@ -1800,7 +1808,7 @@ void MenuFunctions::RunSetup()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_SD
|
#ifdef HAS_SD
|
||||||
#ifndef ILI9341
|
#ifndef HAS_ILI9341
|
||||||
#ifdef HAS_BUTTONS
|
#ifdef HAS_BUTTONS
|
||||||
sdDeleteMenu.parentMenu = &deviceMenu;
|
sdDeleteMenu.parentMenu = &deviceMenu;
|
||||||
this->addNodes(&sdDeleteMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
this->addNodes(&sdDeleteMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ class MenuFunctions
|
|||||||
uint32_t initTime = 0;
|
uint32_t initTime = 0;
|
||||||
uint8_t menu_start_index = 0;
|
uint8_t menu_start_index = 0;
|
||||||
uint8_t mini_kb_index = 0;
|
uint8_t mini_kb_index = 0;
|
||||||
|
uint8_t old_gps_sat_count = 0;
|
||||||
|
|
||||||
// Main menu stuff
|
// Main menu stuff
|
||||||
Menu mainMenu;
|
Menu mainMenu;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
//#define MARAUDER_M5STICKC
|
//#define MARAUDER_M5STICKC
|
||||||
//#define MARAUDER_MINI
|
//#define MARAUDER_MINI
|
||||||
//#define MARAUDER_V4
|
//#define MARAUDER_V4
|
||||||
//#define MARAUDER_V6
|
#define MARAUDER_V6
|
||||||
//#define MARAUDER_V6_1
|
//#define MARAUDER_V6_1
|
||||||
//#define MARAUDER_KIT
|
//#define MARAUDER_KIT
|
||||||
//#define GENERIC_ESP32
|
//#define GENERIC_ESP32
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
//#define ESP32_LDDB
|
//#define ESP32_LDDB
|
||||||
//#define MARAUDER_DEV_BOARD_PRO
|
//#define MARAUDER_DEV_BOARD_PRO
|
||||||
//#define XIAO_ESP32_S3
|
//#define XIAO_ESP32_S3
|
||||||
#define MARAUDER_REV_FEATHER
|
//#define MARAUDER_REV_FEATHER
|
||||||
//// END BOARD TARGETS
|
//// END BOARD TARGETS
|
||||||
|
|
||||||
#define MARAUDER_VERSION "v0.13.9"
|
#define MARAUDER_VERSION "v0.13.9"
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ https://www.online-utility.org/image/convert/to/XBM
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
//#include "Web.h"
|
|
||||||
#include "EvilPortal.h"
|
#include "EvilPortal.h"
|
||||||
#include <Wire.h>
|
#include <Wire.h>
|
||||||
#include "esp_wifi.h"
|
#include "esp_wifi.h"
|
||||||
@@ -45,7 +44,6 @@ https://www.online-utility.org/image/convert/to/XBM
|
|||||||
#include "LedInterface.h"
|
#include "LedInterface.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#include "esp_interface.h"
|
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
#include "CommandLine.h"
|
#include "CommandLine.h"
|
||||||
#include "lang_var.h"
|
#include "lang_var.h"
|
||||||
@@ -54,14 +52,9 @@ https://www.online-utility.org/image/convert/to/XBM
|
|||||||
#include "BatteryInterface.h"
|
#include "BatteryInterface.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#ifdef HAS_TEMP_SENSOR
|
|
||||||
// #include "TemperatureInterface.h"
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
#include "Display.h"
|
#include "Display.h"
|
||||||
#include "MenuFunctions.h"
|
#include "MenuFunctions.h"
|
||||||
//#include "a32u4_interface.h"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_BUTTONS
|
#ifdef HAS_BUTTONS
|
||||||
@@ -87,9 +80,7 @@ https://www.online-utility.org/image/convert/to/XBM
|
|||||||
|
|
||||||
WiFiScan wifi_scan_obj;
|
WiFiScan wifi_scan_obj;
|
||||||
EvilPortal evil_portal_obj;
|
EvilPortal evil_portal_obj;
|
||||||
//Web web_obj;
|
|
||||||
Buffer buffer_obj;
|
Buffer buffer_obj;
|
||||||
//EspInterface esp_obj;
|
|
||||||
Settings settings_obj;
|
Settings settings_obj;
|
||||||
CommandLine cli_obj;
|
CommandLine cli_obj;
|
||||||
|
|
||||||
@@ -101,14 +92,9 @@ CommandLine cli_obj;
|
|||||||
BatteryInterface battery_obj;
|
BatteryInterface battery_obj;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#ifdef HAS_TEMP_SENSOR
|
|
||||||
// TemperatureInterface temp_obj;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
Display display_obj;
|
Display display_obj;
|
||||||
MenuFunctions menu_function_obj;
|
MenuFunctions menu_function_obj;
|
||||||
//A32u4Interface a32u4_obj;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_SD
|
#ifdef HAS_SD
|
||||||
@@ -169,8 +155,6 @@ void setup()
|
|||||||
axp192_obj.begin();
|
axp192_obj.begin();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//pinMode(FLASH_BUTTON, INPUT);
|
|
||||||
|
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
pinMode(TFT_BL, OUTPUT);
|
pinMode(TFT_BL, OUTPUT);
|
||||||
#endif
|
#endif
|
||||||
@@ -198,16 +182,8 @@ void setup()
|
|||||||
|
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
|
|
||||||
//Serial.println("\n\nHello, World!\n");
|
|
||||||
|
|
||||||
Serial.println("ESP-IDF version is: " + String(esp_get_idf_version()));
|
Serial.println("ESP-IDF version is: " + String(esp_get_idf_version()));
|
||||||
|
|
||||||
//#ifdef HAS_SCREEN
|
|
||||||
// Serial.println("Has Screen");
|
|
||||||
//#else
|
|
||||||
// Serial.println("Does not have screen");
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
display_obj.RunSetup();
|
display_obj.RunSetup();
|
||||||
display_obj.tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
display_obj.tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||||
@@ -225,7 +201,6 @@ void setup()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
//showCenterText(version_number, 250);
|
|
||||||
#ifndef MARAUDER_MINI
|
#ifndef MARAUDER_MINI
|
||||||
display_obj.tft.drawCentreString(display_obj.version_number, 120, 250, 2);
|
display_obj.tft.drawCentreString(display_obj.version_number, 120, 250, 2);
|
||||||
#endif
|
#endif
|
||||||
@@ -264,20 +239,10 @@ void setup()
|
|||||||
display_obj.tft.println(text_table0[1]);
|
display_obj.tft.println(text_table0[1]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Serial.println("Internal Temp: " + (String)((temprature_sens_read() - 32) / 1.8));
|
|
||||||
|
|
||||||
settings_obj.begin();
|
settings_obj.begin();
|
||||||
|
|
||||||
//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");
|
|
||||||
//else
|
|
||||||
// Serial.println("This is a test Force PMKID: false");
|
|
||||||
|
|
||||||
wifi_scan_obj.RunSetup();
|
wifi_scan_obj.RunSetup();
|
||||||
|
|
||||||
//Serial.println(wifi_scan_obj.freeRAM());
|
|
||||||
|
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
display_obj.tft.println(F(text_table0[2]));
|
display_obj.tft.println(F(text_table0[2]));
|
||||||
#endif
|
#endif
|
||||||
@@ -309,23 +274,12 @@ void setup()
|
|||||||
display_obj.tft.println(F(text_table0[5]));
|
display_obj.tft.println(F(text_table0[5]));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Temperature stuff
|
|
||||||
//#ifdef HAS_TEMP_SENSOR
|
|
||||||
// temp_obj.RunSetup();
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
display_obj.tft.println(F(text_table0[6]));
|
display_obj.tft.println(F(text_table0[6]));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_BATTERY
|
#ifdef HAS_BATTERY
|
||||||
battery_obj.battery_level = battery_obj.getBatteryLevel();
|
battery_obj.battery_level = battery_obj.getBatteryLevel();
|
||||||
|
|
||||||
// if (battery_obj.i2c_supported) {
|
|
||||||
// Serial.println(F("IP5306 I2C Supported: true"));
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// Serial.println(F("IP5306 I2C Supported: false"));
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Do some LED stuff
|
// Do some LED stuff
|
||||||
@@ -366,12 +320,6 @@ void setup()
|
|||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
menu_function_obj.RunSetup();
|
menu_function_obj.RunSetup();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Serial.println(F("\n\n--------------------------------\n"));
|
|
||||||
//Serial.println(F(" ESP32 Marauder \n"));
|
|
||||||
//Serial.println(" " + version_number + "\n");
|
|
||||||
//Serial.println(F(" By: justcallmekoko\n"));
|
|
||||||
//Serial.println(F("--------------------------------\n\n"));
|
|
||||||
|
|
||||||
Serial.println(F("CLI Ready"));
|
Serial.println(F("CLI Ready"));
|
||||||
cli_obj.RunSetup();
|
cli_obj.RunSetup();
|
||||||
|
|||||||
Reference in New Issue
Block a user