[stock] New option FRSKY_BARS added in Makefile. With FRSKY_BARS=NO around 1k is saved.
This commit is contained in:
+10
-3
@@ -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
|
||||
|
||||
+11
-3
@@ -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<NUM_LINE_ITEMS; c++) {
|
||||
uint8_t cellAttr = (m_posHorz==c ? attr : 0);
|
||||
uint8_t & value = g_model.frsky.screens[screenIndex].lines[lineIndex].sources[c];
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
#define TELEM_2ND_COLUMN (10*FW)
|
||||
#endif
|
||||
|
||||
#if defined(FRSKY_HUB)
|
||||
#if defined(FRSKY_HUB) && defined(FRSKY_BARS)
|
||||
uint8_t barsThresholds[THLD_MAX];
|
||||
#endif
|
||||
|
||||
@@ -202,6 +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 (g_model.frsky.screensType & (1<<s_frsky_view)) {
|
||||
// Custom Screen with gauges
|
||||
uint8_t barHeight = 5;
|
||||
@@ -257,7 +258,9 @@ void menuTelemetryFrsky(uint8_t event)
|
||||
}
|
||||
displayRssiLine();
|
||||
}
|
||||
else {
|
||||
else
|
||||
#endif
|
||||
{
|
||||
// Custom Screen with numbers
|
||||
uint8_t fields_count = 0;
|
||||
for (uint8_t i=0; i<4; i++) {
|
||||
@@ -362,7 +365,11 @@ 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)
|
||||
uint8_t attr = (barsThresholds[THLD_CELL] && frskyData.hub.cellVolts[k] < barsThresholds[THLD_CELL]) ? BLINK|PREC2 : PREC2;
|
||||
#else
|
||||
uint8_t attr = PREC2;
|
||||
#endif
|
||||
lcd_outdezNAtt(LCD_W, y, frskyData.hub.cellVolts[k] * 2, attr, 4);
|
||||
y += 1*FH;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1048,7 +1048,7 @@ bool __getSwitch(int8_t swtch)
|
||||
|
||||
y = convertCswTelemValue(cs);
|
||||
|
||||
#if defined(FRSKY_HUB)
|
||||
#if defined(FRSKY_HUB) && defined(FRSKY_BARS)
|
||||
if (s == CS_VOFS) {
|
||||
uint8_t idx = cs->v1-MIXSRC_FIRST_TELEM+1-TELEM_ALT;
|
||||
if (idx < THLD_MAX) {
|
||||
|
||||
+1
-1
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user