[stock] New Makefile option GPS=YES/NO (saves 1.5k flash if disabled)
[stock] FRSKY_BARS option renamed to GAUGES=YES/NO (it could be used for another telemetry system in the future)
This commit is contained in:
+14
-5
@@ -149,10 +149,15 @@ FRSKY_HUB = YES
|
||||
# Values = YES, NO
|
||||
WS_HOW_HIGH = YES
|
||||
|
||||
# Bars in Telemetry screen
|
||||
FRSKY_BARS = YES
|
||||
# Gauges in Telemetry screen
|
||||
# Values = YES, NO
|
||||
GAUGES = YES
|
||||
|
||||
# WS HowHigh
|
||||
# GPS
|
||||
# Values = YES, NO
|
||||
GPS = YES
|
||||
|
||||
# Vario
|
||||
# Values = YES, NO
|
||||
VARIO = YES
|
||||
|
||||
@@ -833,8 +838,12 @@ ifeq ($(EXT), $(filter $(EXT), FRSKY TELEMETREZ))
|
||||
CPPDEFS += -DWS_HOW_HIGH
|
||||
endif
|
||||
|
||||
ifeq ($(FRSKY_BARS), YES)
|
||||
CPPDEFS += -DFRSKY_BARS
|
||||
ifeq ($(GAUGES), YES)
|
||||
CPPDEFS += -DGAUGES
|
||||
endif
|
||||
|
||||
ifeq ($(GPS), YES)
|
||||
CPPDEFS += -DGPS
|
||||
endif
|
||||
|
||||
ifeq ($(VARIO), YES)
|
||||
|
||||
@@ -169,7 +169,7 @@ enum menuGeneralSetupItems {
|
||||
ITEM_SETUP_DISABLE_SPLASH,
|
||||
#endif
|
||||
IF_FRSKY(ITEM_SETUP_TIMEZONE)
|
||||
IF_FRSKY(ITEM_SETUP_GPSFORMAT)
|
||||
IF_GPS(ITEM_SETUP_GPSFORMAT)
|
||||
IF_PXX(ITEM_SETUP_COUNTRYCODE)
|
||||
IF_CPUARM(ITEM_SETUP_LANGUAGE)
|
||||
IF_CPUARM(ITEM_SETUP_IMPERIAL)
|
||||
@@ -191,7 +191,7 @@ void menuGeneralSetup(uint8_t event)
|
||||
}
|
||||
#endif
|
||||
|
||||
MENU(STR_MENURADIOSETUP, menuTabDiag, e_Setup, ITEM_SETUP_MAX+1, {0, IF_RTCLOCK(2) IF_RTCLOCK(2) IF_BATTGRAPH(1) LABEL(SOUND), IF_AUDIO(0) IF_BUZZER(0) 0, IF_AUDIO(0) IF_VOICE(0) IF_HAPTIC(LABEL(HAPTIC)) IF_HAPTIC(0) IF_HAPTIC(0) IF_HAPTIC(0) IF_PCBSKY9X(0) IF_9X(0) LABEL(ALARMS), 0, IF_PCBSKY9X(0) IF_PCBSKY9X(0) 0, 0, 0, IF_ROTARY_ENCODERS(0) LABEL(BACKLIGHT), 0, 0, CASE_PWM_BACKLIGHT(0) CASE_PWM_BACKLIGHT(0) 0, IF_SPLASH(0) IF_FRSKY(0) IF_FRSKY(0) IF_PXX(0) IF_CPUARM(0) IF_CPUARM(0) 0, LABEL(TX_MODE), CASE_PCBTARANIS(0) 1/*to force edit mode*/});
|
||||
MENU(STR_MENURADIOSETUP, menuTabDiag, e_Setup, ITEM_SETUP_MAX+1, {0, IF_RTCLOCK(2) IF_RTCLOCK(2) IF_BATTGRAPH(1) LABEL(SOUND), IF_AUDIO(0) IF_BUZZER(0) 0, IF_AUDIO(0) IF_VOICE(0) IF_HAPTIC(LABEL(HAPTIC)) IF_HAPTIC(0) IF_HAPTIC(0) IF_HAPTIC(0) IF_PCBSKY9X(0) IF_9X(0) LABEL(ALARMS), 0, IF_PCBSKY9X(0) IF_PCBSKY9X(0) 0, 0, 0, IF_ROTARY_ENCODERS(0) LABEL(BACKLIGHT), 0, 0, CASE_PWM_BACKLIGHT(0) CASE_PWM_BACKLIGHT(0) 0, IF_SPLASH(0) IF_FRSKY(0) IF_GPS(0) IF_PXX(0) IF_CPUARM(0) IF_CPUARM(0) 0, LABEL(TX_MODE), CASE_PCBTARANIS(0) 1/*to force edit mode*/});
|
||||
|
||||
uint8_t sub = m_posVert - 1;
|
||||
|
||||
@@ -493,7 +493,9 @@ void menuGeneralSetup(uint8_t event)
|
||||
lcd_outdezAtt(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.timezone, attr|LEFT);
|
||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.timezone, -12, 12);
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(FRSKY) && defined(FRSKY_HUB) && defined(GPS)
|
||||
case ITEM_SETUP_GPSFORMAT:
|
||||
g_eeGeneral.gpsFormat = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, STR_GPSCOORD, STR_GPSFORMAT, g_eeGeneral.gpsFormat, 0, 1, attr, event);
|
||||
break;
|
||||
|
||||
+15
-15
@@ -97,7 +97,7 @@ static uint8_t s_copyMode = 0;
|
||||
static int8_t s_copySrcRow;
|
||||
static int8_t s_copyTgtOfs;
|
||||
|
||||
inline uint8_t eeFindEmptyModel(uint8_t id, bool down)
|
||||
uint8_t eeFindEmptyModel(uint8_t id, bool down)
|
||||
{
|
||||
uint8_t i = id;
|
||||
for (;;) {
|
||||
@@ -108,6 +108,16 @@ inline uint8_t eeFindEmptyModel(uint8_t id, bool down)
|
||||
return i;
|
||||
}
|
||||
|
||||
void selectModel(uint8_t sub)
|
||||
{
|
||||
displayPopup(STR_LOADINGMODEL);
|
||||
saveTimers();
|
||||
eeCheck(true); // force writing of current model data before this is changed
|
||||
g_eeGeneral.currModel = sub;
|
||||
STORE_GENERALVARS;
|
||||
eeLoadModel(sub);
|
||||
}
|
||||
|
||||
#if defined(SDCARD)
|
||||
#define LIST_NONE_SD_FILE 1
|
||||
bool listSdFiles(const char *path, const char *extension, const uint8_t maxlen, const char *selection, uint8_t flags=0)
|
||||
@@ -305,16 +315,6 @@ void onModelSelectMenu(const char *result)
|
||||
}
|
||||
#endif
|
||||
|
||||
void selectModel(uint8_t sub)
|
||||
{
|
||||
displayPopup(STR_LOADINGMODEL);
|
||||
saveTimers();
|
||||
eeCheck(true); // force writing of current model data before this is changed
|
||||
g_eeGeneral.currModel = sub;
|
||||
STORE_GENERALVARS;
|
||||
eeLoadModel(sub);
|
||||
}
|
||||
|
||||
void menuModelSelect(uint8_t event)
|
||||
{
|
||||
if (s_warning_result) {
|
||||
@@ -4429,7 +4429,7 @@ enum menuModelTelemetryItems {
|
||||
#define RSSI_ROWS (uint8_t)-1, 1, 1,
|
||||
#endif
|
||||
|
||||
#if defined(FRSKY_BARS)
|
||||
#if defined(GAUGES)
|
||||
#define SCREEN_TYPE_ROWS 0
|
||||
#else
|
||||
#define SCREEN_TYPE_ROWS (uint8_t)-1
|
||||
@@ -4654,7 +4654,7 @@ void menuModelTelemetry(uint8_t event)
|
||||
{
|
||||
uint8_t screenIndex = (k < ITEM_TELEMETRY_SCREEN_LABEL2 ? 0 : (k < ITEM_TELEMETRY_SCREEN_LABEL3 ? 1 : 2));
|
||||
putsStrIdx(0*FW, y, STR_SCREEN, screenIndex+1);
|
||||
#if defined(FRSKY_BARS)
|
||||
#if defined(GAUGES)
|
||||
bool screenType = IS_BARS_SCREEN(screenIndex);
|
||||
if (screenType != selectMenuItem(TELEM_SCRTYPE_COL, y, PSTR(""), STR_VSCREEN, screenType, 0, 1, attr, event))
|
||||
g_model.frsky.screensType ^= (1 << screenIndex);
|
||||
@@ -4665,7 +4665,7 @@ void menuModelTelemetry(uint8_t event)
|
||||
{
|
||||
uint8_t screenIndex = (k < ITEM_TELEMETRY_SCREEN_LABEL2 ? 1 : 2);
|
||||
putsStrIdx(0*FW, y, STR_SCREEN, screenIndex);
|
||||
#if defined(FRSKY_BARS)
|
||||
#if defined(GAUGES)
|
||||
bool screenType = g_model.frsky.screensType & screenIndex;
|
||||
if (screenType != selectMenuItem(TELEM_SCRTYPE_COL, y, PSTR(""), STR_VSCREEN, screenType, 0, 1, attr, event))
|
||||
g_model.frsky.screensType ^= screenIndex;
|
||||
@@ -4711,7 +4711,7 @@ void menuModelTelemetry(uint8_t event)
|
||||
putsStrIdx(0, y, PSTR(INDENT"Line"), lineIndex+1, m_posHorz<0 ? attr : 0);
|
||||
#endif
|
||||
|
||||
#if defined(FRSKY_BARS)
|
||||
#if defined(GAUGES)
|
||||
if (IS_BARS_SCREEN(screenIndex)) {
|
||||
FrSkyBarData & bar = g_model.frsky.screens[screenIndex].bars[lineIndex];
|
||||
uint8_t barSource = bar.source;
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
#define TELEM_2ND_COLUMN (10*FW)
|
||||
#endif
|
||||
|
||||
#if defined(FRSKY_HUB) && defined(FRSKY_BARS)
|
||||
#if defined(FRSKY_HUB) && defined(GAUGES)
|
||||
uint8_t barsThresholds[THLD_MAX];
|
||||
#endif
|
||||
|
||||
@@ -202,7 +202,7 @@ void menuTelemetryFrsky(uint8_t event)
|
||||
|
||||
if (s_frsky_view < MAX_FRSKY_SCREENS) {
|
||||
FrSkyScreenData & screen = g_model.frsky.screens[s_frsky_view];
|
||||
#if defined(FRSKY_BARS)
|
||||
#if defined(GAUGES)
|
||||
if (g_model.frsky.screensType & (1<<s_frsky_view)) {
|
||||
// Custom Screen with gauges
|
||||
uint8_t barHeight = 5;
|
||||
@@ -365,7 +365,7 @@ void menuTelemetryFrsky(uint8_t event)
|
||||
if (frskyData.hub.cellsCount > 0) {
|
||||
uint8_t y = 1*FH;
|
||||
for (uint8_t k=0; k<frskyData.hub.cellsCount && k<6; k++) {
|
||||
#if defined(FRSKY_BARS)
|
||||
#if defined(GAUGES)
|
||||
uint8_t attr = (barsThresholds[THLD_CELL] && frskyData.hub.cellVolts[k] < barsThresholds[THLD_CELL]) ? BLINK|PREC2 : PREC2;
|
||||
#else
|
||||
uint8_t attr = PREC2;
|
||||
@@ -382,7 +382,7 @@ void menuTelemetryFrsky(uint8_t event)
|
||||
#if defined(FRSKY_HUB)
|
||||
else if (s_frsky_view == e_frsky_after_flight) {
|
||||
uint8_t line=1*FH+1;
|
||||
if (IS_USR_PROTO_FRSKY_HUB()) {
|
||||
if (IS_GPS_AVAILABLE()) {
|
||||
// Latitude
|
||||
lcd_putsLeft(line, STR_LATITUDE);
|
||||
displayGpsCoord(line, frskyData.hub.gpsLatitudeNS, frskyData.hub.gpsLatitude_bp, frskyData.hub.gpsLatitude_ap);
|
||||
|
||||
+1
-1
@@ -1048,7 +1048,7 @@ bool __getSwitch(int8_t swtch)
|
||||
|
||||
y = convertCswTelemValue(cs);
|
||||
|
||||
#if defined(FRSKY_HUB) && defined(FRSKY_BARS)
|
||||
#if defined(FRSKY_HUB) && defined(GAUGES)
|
||||
if (s == CS_VOFS) {
|
||||
uint8_t idx = cs->v1-MIXSRC_FIRST_TELEM+1-TELEM_ALT;
|
||||
if (idx < THLD_MAX) {
|
||||
|
||||
+13
-1
@@ -110,6 +110,12 @@
|
||||
#define CASE_PWM_BACKLIGHT(x)
|
||||
#endif
|
||||
|
||||
#if defined(FRSKY) && defined(FRSKY_HUB) && defined(GPS)
|
||||
#define IF_GPS(x) x,
|
||||
#else
|
||||
#define IF_GPS(x)
|
||||
#endif
|
||||
|
||||
#if defined(VARIO)
|
||||
#define IF_VARIO(x) x,
|
||||
#else
|
||||
@@ -1363,7 +1369,7 @@ char * strcat_zchar(char * dest, char * name, uint8_t size, const char *defaultN
|
||||
#define STICK_TOLERANCE 64
|
||||
#endif
|
||||
|
||||
#if defined(FRSKY_HUB) && defined(FRSKY_BARS)
|
||||
#if defined(FRSKY_HUB) && defined(GAUGES)
|
||||
enum BarThresholdIdx {
|
||||
THLD_ALT,
|
||||
THLD_RPM,
|
||||
@@ -1437,6 +1443,12 @@ void varioWakeup();
|
||||
#define IS_USR_PROTO_WS_HOW_HIGH() (g_model.frsky.usrProto == USR_PROTO_WS_HOW_HIGH)
|
||||
#endif
|
||||
|
||||
#if defined(FRSKY) && defined(FRSKY_HUB) && defined(GPS)
|
||||
#define IS_GPS_AVAILABLE() IS_USR_PROTO_FRSKY_HUB()
|
||||
#else
|
||||
#define IS_GPS_AVAILABLE() (0)
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
extern const pm_uchar logo_taranis[];
|
||||
#endif
|
||||
|
||||
@@ -227,6 +227,7 @@ void parseTelemHubByte(uint8_t byte)
|
||||
frskyData.hub.minAltitude = frskyData.hub.gpsAltitude_bp;
|
||||
}
|
||||
|
||||
#if defined(GPS)
|
||||
if (!frskyData.hub.pilotLatitude && !frskyData.hub.pilotLongitude) {
|
||||
// First received GPS position => Pilot GPS position
|
||||
getGpsPilotPosition();
|
||||
@@ -234,6 +235,7 @@ void parseTelemHubByte(uint8_t byte)
|
||||
else if (frskyData.hub.gpsDistNeeded || g_menuStack[g_menuStackPtr] == menuTelemetryFrsky) {
|
||||
getGpsDistance();
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
case offsetof(FrskyHubData, gpsSpeed_bp):
|
||||
@@ -842,6 +844,7 @@ void resetTelemetry()
|
||||
frskyData.hub.fuelLevel = 75;
|
||||
frskyData.hub.rpm = 12000;
|
||||
|
||||
#if defined(GPS)
|
||||
frskyData.hub.gpsFix = 1;
|
||||
frskyData.hub.gpsLatitude_bp = 4401;
|
||||
frskyData.hub.gpsLatitude_ap = 7710;
|
||||
@@ -855,6 +858,7 @@ void resetTelemetry()
|
||||
frskyData.hub.gpsLongitude_bp = 1006;
|
||||
frskyData.hub.gpsLongitude_ap = 9533;
|
||||
getGpsDistance();
|
||||
#endif
|
||||
|
||||
frskyData.hub.cellsCount = 6;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user