diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index 1c327117e..9736cf9d1 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -327,7 +327,11 @@ void menuHandler::positionBaseMenu() } screen->showOverlayBanner("Position Action", 30000, optionsArrayPtr, options, [](int selected) -> void { if (selected == 1) { +#if MESHTASTIC_EXCLUDE_GPS + menuQueue = menu_none; +#else menuQueue = gps_toggle_menu; +#endif } else if (selected == 2) { menuQueue = compass_point_north_menu; } else if (selected == 3) { @@ -390,6 +394,7 @@ void menuHandler::compassNorthMenu() }); } +#if !MESHTASTIC_EXCLUDE_GPS void menuHandler::GPSToggleMenu() { static const char *optionsArray[] = {"Back", "Enabled", "Disabled"}; @@ -412,6 +417,7 @@ void menuHandler::GPSToggleMenu() }, config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_ENABLED ? 1 : 2); // set inital selection } +#endif void menuHandler::BuzzerModeMenu() { @@ -461,9 +467,11 @@ void menuHandler::handleMenuSwitch() case position_base_menu: positionBaseMenu(); break; +#if !MESHTASTIC_EXCLUDE_GPS case gps_toggle_menu: GPSToggleMenu(); break; +#endif case compass_point_north_menu: compassNorthMenu(); break; diff --git a/src/graphics/draw/MenuHandler.h b/src/graphics/draw/MenuHandler.h index a5bea5176..5a5ee8bf6 100644 --- a/src/graphics/draw/MenuHandler.h +++ b/src/graphics/draw/MenuHandler.h @@ -13,7 +13,9 @@ class menuHandler clock_face_picker, clock_menu, position_base_menu, +#if !MESHTASTIC_EXCLUDE_GPS gps_toggle_menu, +#endif compass_point_north_menu, reset_node_db_menu }; diff --git a/src/graphics/draw/UIRenderer.cpp b/src/graphics/draw/UIRenderer.cpp index 1738a8246..9c3a9eabb 100644 --- a/src/graphics/draw/UIRenderer.cpp +++ b/src/graphics/draw/UIRenderer.cpp @@ -44,22 +44,20 @@ std::string sanitizeString(const std::string &input) return output; } -#if !MESHTASTIC_EXCLUDE_GPS - // External variables extern graphics::Screen *screen; namespace graphics { +NodeNum UIRenderer::currentFavoriteNodeNum = 0; +#if !MESHTASTIC_EXCLUDE_GPS // GeoCoord object for coordinate conversions extern GeoCoord geoCoord; // Threshold values for the GPS lock accuracy bar display extern uint32_t dopThresholds[5]; -NodeNum UIRenderer::currentFavoriteNodeNum = 0; - // Draw GPS status summary void UIRenderer::drawGps(OLEDDisplay *display, int16_t x, int16_t y, const meshtastic::GPSStatus *gps) { @@ -188,6 +186,7 @@ void UIRenderer::drawGpsCoordinates(OLEDDisplay *display, int16_t x, int16_t y, } } } +#endif // !MESHTASTIC_EXCLUDE_GPS // Draw nodes status void UIRenderer::drawNodes(OLEDDisplay *display, int16_t x, int16_t y, const meshtastic::NodeStatus *nodeStatus, int node_offset, @@ -1242,5 +1241,4 @@ std::string UIRenderer::drawTimeDelta(uint32_t days, uint32_t hours, uint32_t mi } // namespace graphics -#endif // !MESHTASTIC_EXCLUDE_GPS #endif // HAS_SCREEN \ No newline at end of file