1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-20 14:55:21 +03:00

DISPLAY - Only compile in GPS page if GPS is enabled.

This commit is contained in:
Dominic Clifton 2014-12-13 19:37:27 +00:00
parent f78b80fe01
commit 9bcc0acd18

View file

@ -41,8 +41,10 @@
#include "sensors/sensors.h" #include "sensors/sensors.h"
#include "sensors/compass.h" #include "sensors/compass.h"
#ifdef GPS
#include "io/gps.h" #include "io/gps.h"
#include "flight/navigation.h" #include "flight/navigation.h"
#endif
#include "rx/rx.h" #include "rx/rx.h"
#include "io/rc_controls.h" #include "io/rc_controls.h"
@ -76,11 +78,12 @@ const char* pageTitles[] = {
"BATTERY", "BATTERY",
"SENSORS", "SENSORS",
"RX", "RX",
"PROFILE", "PROFILE"
"GPS" #ifdef GPS
,"GPS"
#endif
#ifdef ENABLE_DEBUG_OLED_PAGE #ifdef ENABLE_DEBUG_OLED_PAGE
, ,"DEBUG"
"DEBUG"
#endif #endif
}; };
@ -88,13 +91,14 @@ const char* pageTitles[] = {
const uint8_t cyclePageIds[] = { const uint8_t cyclePageIds[] = {
PAGE_PROFILE, PAGE_PROFILE,
#ifdef GPS
PAGE_GPS, PAGE_GPS,
#endif
PAGE_RX, PAGE_RX,
PAGE_BATTERY, PAGE_BATTERY,
PAGE_SENSORS PAGE_SENSORS
#ifdef ENABLE_DEBUG_OLED_PAGE #ifdef ENABLE_DEBUG_OLED_PAGE
, ,PAGE_DEBUG,
PAGE_DEBUG,
#endif #endif
}; };
@ -279,6 +283,7 @@ void showProfilePage(void)
} }
#ifdef GPS
void showGpsPage() { void showGpsPage() {
uint8_t rowIndex = PAGE_TITLE_LINE_COUNT; uint8_t rowIndex = PAGE_TITLE_LINE_COUNT;
@ -327,6 +332,7 @@ void showGpsPage() {
i2c_OLED_send_string(lineBuffer); i2c_OLED_send_string(lineBuffer);
#endif #endif
} }
#endif
void showBatteryPage(void) void showBatteryPage(void)
{ {
@ -461,9 +467,11 @@ void updateDisplay(void)
case PAGE_PROFILE: case PAGE_PROFILE:
showProfilePage(); showProfilePage();
break; break;
#ifdef GPS
case PAGE_GPS: case PAGE_GPS:
showGpsPage(); showGpsPage();
break; break;
#endif
#ifdef ENABLE_DEBUG_OLED_PAGE #ifdef ENABLE_DEBUG_OLED_PAGE
case PAGE_DEBUG: case PAGE_DEBUG:
showDebugPage(); showDebugPage();