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