Enable LED for C5

This commit is contained in:
Just Call Me Koko
2025-09-03 12:03:58 -04:00
parent d131491bbf
commit 605086ea59
2 changed files with 21 additions and 26 deletions

View File

@@ -1126,6 +1126,17 @@ void MenuFunctions::main(uint32_t currentTime)
}
if(menu_button == SELECT_BUTTON) {
current_menu->list->get(current_menu->selected).callable();
}
if (menu_button == LEFT_BUTTON) {
if (wifi_scan_obj.currentScanMode == WIFI_SCAN_OFF) {
if (wifi_scan_obj.set_channel > 1)
wifi_scan_obj.changeChannel(wifi_scan_obj.set_channel - 1);
else
wifi_scan_obj.changeChannel(14);
}
}
if (menu_button == RIGHT_BUTTON) {
}
else {
if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_OFF) ||
@@ -1898,7 +1909,6 @@ void MenuFunctions::RunSetup()
deviceMenu.list = new LinkedList<MenuNode>();
#ifdef HAS_GPS
if (gps_obj.getGpsModuleStatus()) {
gpsMenu.list = new LinkedList<MenuNode>(); // H4W9 Added GPS Menu
gpsInfoMenu.list = new LinkedList<MenuNode>();
}
#endif
@@ -2011,7 +2021,6 @@ void MenuFunctions::RunSetup()
//#endif
#ifdef HAS_GPS
gpsInfoMenu.name = "GPS Data";
gpsMenu.name = "GPS"; // H4W9 Added GPS Menu
wardrivingMenu.name = "Wardriving";
#endif
htmlMenu.name = "EP HTML List";
@@ -2037,14 +2046,6 @@ void MenuFunctions::RunSetup()
this->addNodes(&mainMenu, text_table1[19], TFTCYAN, NULL, BLUETOOTH, [this]() {
this->changeMenu(&bluetoothMenu);
});
// H4W9 Added GPS Menu option to Main Menu
#ifdef HAS_GPS
this->addNodes(&mainMenu, text1_66, TFTRED, NULL, GPS_MENU, [this]() {
this->changeMenu(&gpsMenu);
});
#endif
this->addNodes(&mainMenu, text_table1[9], TFTBLUE, NULL, DEVICE, [this]() {
this->changeMenu(&deviceMenu);
});
@@ -3321,43 +3322,35 @@ void MenuFunctions::RunSetup()
this->changeMenu(loadATsMenu.parentMenu);
});
// H4W9 Moved GPS functions to GPS Menu
// Build GPS Menu
// GPS Menu
#ifdef HAS_GPS
if (gps_obj.getGpsModuleStatus()) {
gpsMenu.parentMenu = &mainMenu; // Main Menu is second menu parent
this->addNodes(&gpsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(gpsMenu.parentMenu);
});
this->addNodes(&gpsMenu, "GPS Data", TFTRED, NULL, GPS_MENU, [this]() {
this->addNodes(&deviceMenu, "GPS Data", TFTRED, NULL, GPS_MENU, [this]() {
wifi_scan_obj.currentScanMode = WIFI_SCAN_GPS_DATA;
this->changeMenu(&gpsInfoMenu);
wifi_scan_obj.StartScan(WIFI_SCAN_GPS_DATA, TFT_CYAN);
});
this->addNodes(&gpsMenu, "NMEA Stream", TFTORANGE, NULL, GPS_MENU, [this]() {
this->addNodes(&deviceMenu, "NMEA Stream", TFTORANGE, NULL, GPS_MENU, [this]() {
wifi_scan_obj.currentScanMode = WIFI_SCAN_GPS_NMEA;
this->changeMenu(&gpsInfoMenu);
wifi_scan_obj.StartScan(WIFI_SCAN_GPS_NMEA, TFT_ORANGE);
});
this->addNodes(&gpsMenu, "GPS Tracker", TFTGREEN, NULL, GPS_MENU, [this]() {
this->addNodes(&deviceMenu, "GPS Tracker", TFTGREEN, NULL, GPS_MENU, [this]() {
wifi_scan_obj.currentScanMode = GPS_TRACKER;
this->changeMenu(&gpsInfoMenu);
wifi_scan_obj.StartScan(GPS_TRACKER, TFT_CYAN);
});
this->addNodes(&gpsMenu, "GPS POI", TFTCYAN, NULL, GPS_MENU, [this]() {
this->addNodes(&deviceMenu, "GPS POI", TFTCYAN, NULL, GPS_MENU, [this]() {
wifi_scan_obj.StartScan(GPS_POI, TFT_CYAN);
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
this->changeMenu(&gpsPOIMenu);
});
// GPS POI Menu
gpsPOIMenu.parentMenu = &gpsMenu;
gpsPOIMenu.parentMenu = &deviceMenu;
this->addNodes(&gpsPOIMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
wifi_scan_obj.currentScanMode = GPS_POI;
wifi_scan_obj.StartScan(WIFI_SCAN_OFF);
@@ -3382,7 +3375,7 @@ void MenuFunctions::RunSetup()
});
// GPS Info Menu
gpsInfoMenu.parentMenu = &gpsMenu;
gpsInfoMenu.parentMenu = &deviceMenu;
this->addNodes(&gpsInfoMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
if(wifi_scan_obj.currentScanMode != GPS_TRACKER)
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;

View File

@@ -382,7 +382,7 @@
//#define HAS_BATTERY
//#define HAS_BT
//#define HAS_BUTTONS
//#define HAS_NEOPIXEL_LED
#define HAS_NEOPIXEL_LED
//#define HAS_PWR_MGMT
//#define HAS_SCREEN
#define HAS_GPS
@@ -1976,6 +1976,8 @@
#define PIN 4
#elif defined(MARAUDER_CYD_2USB)
#define PIN 4
#elif defined(MARAUDER_C5)
#define PIN 27
#else
#define PIN 25
#endif