[stock] New option FRSKY_BARS added in Makefile. With FRSKY_BARS=NO around 1k is saved.

This commit is contained in:
bsongis@gmail.com
2013-05-21 05:28:40 +00:00
parent 59fdea8ee5
commit bc2a9e1fd5
5 changed files with 32 additions and 10 deletions
+11 -3
View File
@@ -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];
+9 -2
View File
@@ -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;
}