From bc2a9e1fd536b612a1bd96098d3c509b2423f2f6 Mon Sep 17 00:00:00 2001 From: "bsongis@gmail.com" Date: Tue, 21 May 2013 05:28:40 +0000 Subject: [PATCH] [stock] New option FRSKY_BARS added in Makefile. With FRSKY_BARS=NO around 1k is saved. --- src/Makefile | 13 ++++++++++--- src/gui/menu_model.cpp | 14 +++++++++++--- src/gui/view_telemetry.cpp | 11 +++++++++-- src/opentx.cpp | 2 +- src/opentx.h | 2 +- 5 files changed, 32 insertions(+), 10 deletions(-) diff --git a/src/Makefile b/src/Makefile index c0972c3b6..3a1c93228 100644 --- a/src/Makefile +++ b/src/Makefile @@ -149,6 +149,9 @@ FRSKY_HUB = YES # Values = YES, NO WS_HOW_HIGH = YES +# Bars in Telemetry screen +FRSKY_BARS = YES + # WS HowHigh # Values = YES, NO VARIO = YES @@ -821,15 +824,19 @@ ifeq ($(EXT), $(filter $(EXT), FRSKY TELEMETREZ)) CPPSRC += telemetry/frsky.cpp endif CPPSRC += gui/view_telemetry.cpp - # If FRSKY-Hub is enabled + ifeq ($(FRSKY_HUB), YES) CPPDEFS += -DFRSKY_HUB endif - # If WS HowHigh is enabled + ifeq ($(WS_HOW_HIGH), YES) CPPDEFS += -DWS_HOW_HIGH endif - # If Vario is enabled + + ifeq ($(FRSKY_BARS), YES) + CPPDEFS += -DFRSKY_BARS + endif + ifeq ($(VARIO), YES) CPPDEFS += -DVARIO endif diff --git a/src/gui/menu_model.cpp b/src/gui/menu_model.cpp index cd668ee76..7fca0ed5f 100644 --- a/src/gui/menu_model.cpp +++ b/src/gui/menu_model.cpp @@ -4653,23 +4653,28 @@ void menuModelTelemetry(uint8_t event) case ITEM_TELEMETRY_SCREEN_LABEL1: case ITEM_TELEMETRY_SCREEN_LABEL2: +// TODO merge this code #if defined(CPUARM) case ITEM_TELEMETRY_SCREEN_LABEL3: { uint8_t screenIndex = (k < ITEM_TELEMETRY_SCREEN_LABEL2 ? 0 : (k < ITEM_TELEMETRY_SCREEN_LABEL3 ? 1 : 2)); - bool screenType = IS_BARS_SCREEN(screenIndex); putsStrIdx(0*FW, y, STR_SCREEN, screenIndex+1); +#if defined(FRSKY_BARS) + 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); +#endif break; } #else { uint8_t screenIndex = (k < ITEM_TELEMETRY_SCREEN_LABEL2 ? 1 : 2); - bool screenType = g_model.frsky.screensType & screenIndex; putsStrIdx(0*FW, y, STR_SCREEN, screenIndex); +#if defined(FRSKY_BARS) + 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; +#endif break; } #endif @@ -4711,6 +4716,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 (IS_BARS_SCREEN(screenIndex)) { FrSkyBarData & bar = g_model.frsky.screens[screenIndex].bars[lineIndex]; uint8_t barSource = bar.source; @@ -4740,7 +4746,9 @@ void menuModelTelemetry(uint8_t event) } } } - else { + else +#endif + { for (uint8_t c=0; c 0) { uint8_t y = 1*FH; for (uint8_t k=0; kv1-MIXSRC_FIRST_TELEM+1-TELEM_ALT; if (idx < THLD_MAX) { diff --git a/src/opentx.h b/src/opentx.h index 1258303f5..1305e454f 100644 --- a/src/opentx.h +++ b/src/opentx.h @@ -1363,7 +1363,7 @@ char * strcat_zchar(char * dest, char * name, uint8_t size, const char *defaultN #define STICK_TOLERANCE 64 #endif -#if defined(FRSKY_HUB) +#if defined(FRSKY_HUB) && defined(FRSKY_BARS) enum BarThresholdIdx { THLD_ALT, THLD_RPM,