From 72dc022dc9d25ba76904ff69cdfe4aff55ae2c83 Mon Sep 17 00:00:00 2001 From: bsongis Date: Tue, 10 Jun 2014 14:50:37 +0200 Subject: [PATCH] Fixes #1182 - RxBatt removed --- companion/src/eeprominterface.cpp | 3 +- companion/src/eeprominterface.h | 3 - .../src/firmwares/opentx/opentxeeprom.cpp | 13 +- companion/src/modeledit/telemetry.cpp | 29 - companion/src/modeledit/telemetry.h | 2 - companion/src/modeledit/telemetry.ui | 560 +++++++----------- radio/src/eeprom_conversions.cpp | 7 +- radio/src/gui/menu_model.cpp | 30 +- radio/src/gui/menus.cpp | 3 + radio/src/gui/view_main.cpp | 6 +- radio/src/gui/view_telemetry.cpp | 5 - radio/src/lcd.cpp | 17 - radio/src/mixer.cpp | 1 - radio/src/myeeprom.h | 7 +- radio/src/opentx.cpp | 7 - radio/src/telemetry/frsky.cpp | 20 +- radio/src/telemetry/frsky.h | 1 - radio/src/telemetry/frsky_sport.cpp | 2 +- radio/src/translations/cz.h.txt | 4 +- radio/src/translations/de.h.txt | 4 +- radio/src/translations/en.h.txt | 14 +- radio/src/translations/es.h.txt | 4 +- radio/src/translations/fi.h.txt | 4 +- radio/src/translations/fr.h.txt | 12 +- radio/src/translations/it.h.txt | 2 +- radio/src/translations/pl.h.txt | 4 +- radio/src/translations/pt.h.txt | 4 +- radio/src/translations/se.h.txt | 4 +- 28 files changed, 256 insertions(+), 516 deletions(-) diff --git a/companion/src/eeprominterface.cpp b/companion/src/eeprominterface.cpp index 16318dd0c..b877cdf0b 100644 --- a/companion/src/eeprominterface.cpp +++ b/companion/src/eeprominterface.cpp @@ -263,7 +263,7 @@ QString RawSource::toString() static const QString telemetry[] = { QObject::tr("Batt"), QObject::tr("Time"), QObject::tr("Timer1"), QObject::tr("Timer2"), - QObject::tr("SWR"), QObject::tr("RSSI Tx"), QObject::tr("RSSI Rx"), QObject::tr("Rx Batt"), + QObject::tr("SWR"), QObject::tr("RSSI Tx"), QObject::tr("RSSI Rx"), QObject::tr("A1"), QObject::tr("A2"), QObject::tr("A3"), QObject::tr("A4"), QObject::tr("Alt"), QObject::tr("Rpm"), QObject::tr("Fuel"), QObject::tr("T1"), QObject::tr("T2"), QObject::tr("Speed"), QObject::tr("Dist"), QObject::tr("GPS Alt"), @@ -991,7 +991,6 @@ void FrSkyData::clear() memset(this, 0, sizeof(FrSkyData)); rssiAlarms[0].clear(2, 45); rssiAlarms[1].clear(3, 42); - rxBattAlarms[1] = round(43.0*255/132); varioSource = 2/*VARIO*/; blades = 2; } diff --git a/companion/src/eeprominterface.h b/companion/src/eeprominterface.h index c280d2202..9f540ca7c 100644 --- a/companion/src/eeprominterface.h +++ b/companion/src/eeprominterface.h @@ -229,7 +229,6 @@ enum TelemetrySource { TELEMETRY_SOURCE_SWR, TELEMETRY_SOURCE_RSSI_TX, TELEMETRY_SOURCE_RSSI_RX, - TELEMETRY_SOURCE_RX_BATT, TELEMETRY_SOURCE_A1, TELEMETRY_SOURCE_A2, TELEMETRY_SOURCE_A3, @@ -871,7 +870,6 @@ enum TelemetryVarioSources { }; enum TelemetryVoltsSources { - TELEMETRY_VOLTS_SOURCE_RXBATT, TELEMETRY_VOLTS_SOURCE_A1, TELEMETRY_VOLTS_SOURCE_A2, TELEMETRY_VOLTS_SOURCE_A3, @@ -910,7 +908,6 @@ class FrSkyData { bool mAhPersistent; unsigned int storedMah; int fasOffset; - unsigned int rxBattAlarms[2]; void clear(); }; diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index 58d756264..1acb9fb3e 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -260,15 +260,17 @@ class SourcesConversionTable: public ConversionTable { for (int i=0; i= 216 && IS_ARM(board)) { + if (i==TELEMETRY_SOURCE_RSSI_RX) + val += 1; if (i==TELEMETRY_SOURCE_TX_TIME) val += 5; if (i==TELEMETRY_SOURCE_DTE) @@ -414,7 +416,7 @@ class TelemetrySourcesConversionTable: public ConversionTable { addConversion(1+TELEMETRY_SOURCE_RSSI_TX, val++); addConversion(1+TELEMETRY_SOURCE_RSSI_RX, val++); if (IS_ARM(board) && version >= 216) - addConversion(1+TELEMETRY_SOURCE_RX_BATT, val++); + addConversion(1+TELEMETRY_SOURCE_RESERVE, val++); addConversion(1+TELEMETRY_SOURCE_A1, val++); addConversion(1+TELEMETRY_SOURCE_A2, val++); if (IS_ARM(board) && version >= 216) { @@ -2208,8 +2210,6 @@ class TelemetryVoltsSourceConversionTable: public ConversionTable TelemetryVoltsSourceConversionTable(BoardEnum board, unsigned int version) { int val = 0; - if (IS_ARM(board) && version >= 216) - addConversion(TELEMETRY_VOLTS_SOURCE_RXBATT, val++); addConversion(TELEMETRY_VOLTS_SOURCE_A1, val++); addConversion(TELEMETRY_VOLTS_SOURCE_A2, val++); if (IS_ARM(board) && version >= 216) { @@ -2575,8 +2575,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne } if (IS_ARM(board) && version >= 216) { - internalField.Append(new UnsignedField<8>(modelData.frsky.rxBattAlarms[0])); - internalField.Append(new UnsignedField<8>(modelData.frsky.rxBattAlarms[1])); + internalField.Append(new SpareBitsField<16>()); } } diff --git a/companion/src/modeledit/telemetry.cpp b/companion/src/modeledit/telemetry.cpp index 655776f3e..2b2c8c7c4 100644 --- a/companion/src/modeledit/telemetry.cpp +++ b/companion/src/modeledit/telemetry.cpp @@ -530,20 +530,6 @@ void TelemetryPanel::setup() lock = true; - if (IS_ARM(firmware->getBoard())) { - ui->rxbattAlarm1DSB->setValue((13.2*model.frsky.rxBattAlarms[0])/255); - ui->rxbattAlarm2DSB->setValue((13.2*model.frsky.rxBattAlarms[1])/255); - } - else { - ui->rxbattLabel->hide(); - ui->rxbattAlarm1Label->hide(); - ui->rxbattAlarm2Label->hide(); - ui->rxbattAlarm1CB->hide(); - ui->rxbattAlarm2CB->hide(); - ui->rxbattAlarm1DSB->hide(); - ui->rxbattAlarm2DSB->hide(); - } - ui->rssiAlarm1SB->setValue(model.frsky.rssiAlarms[0].value); ui->rssiAlarm2SB->setValue(model.frsky.rssiAlarms[1].value); if (!IS_TARANIS(GetEepromInterface()->getBoard())) { @@ -692,9 +678,6 @@ void TelemetryPanel::populateVoltsSource() { QUnsignedAutoComboBox * cb = ui->frskyVoltCB; cb->setField(&model.frsky.voltsSource, this); - if (IS_ARM(firmware->getBoard())) { - cb->addItem(tr("RxBatt"), TELEMETRY_VOLTS_SOURCE_RXBATT); - } cb->addItem(tr("A1"), TELEMETRY_VOLTS_SOURCE_A1); cb->addItem(tr("A2"), TELEMETRY_VOLTS_SOURCE_A2); if (IS_ARM(firmware->getBoard())) { @@ -790,18 +773,6 @@ void TelemetryPanel::on_varioLimitMin_DSB_editingFinished() emit modified(); } -void TelemetryPanel::on_rxbattAlarm1DSB_editingFinished() -{ - model.frsky.rxBattAlarms[0] = round(ui->rxbattAlarm1DSB->value()/(13.2/255)); - emit modified(); -} - -void TelemetryPanel::on_rxbattAlarm2DSB_editingFinished() -{ - model.frsky.rxBattAlarms[1] = round(ui->rxbattAlarm2DSB->value()/(13.2/255)); - emit modified(); -} - void TelemetryPanel::on_varioLimitMax_DSB_editingFinished() { model.frsky.varioMax = round(ui->varioLimitMax_DSB->value()-10); diff --git a/companion/src/modeledit/telemetry.h b/companion/src/modeledit/telemetry.h index 631f6d785..6694ae319 100644 --- a/companion/src/modeledit/telemetry.h +++ b/companion/src/modeledit/telemetry.h @@ -93,8 +93,6 @@ class TelemetryPanel : public ModelPanel void on_rssiAlarm2CB_currentIndexChanged(int index); void on_rssiAlarm1SB_editingFinished(); void on_rssiAlarm2SB_editingFinished(); - void on_rxbattAlarm1DSB_editingFinished(); - void on_rxbattAlarm2DSB_editingFinished(); void on_AltitudeGPS_ChkB_toggled(bool checked); void on_varioLimitMin_DSB_editingFinished(); void on_varioLimitMax_DSB_editingFinished(); diff --git a/companion/src/modeledit/telemetry.ui b/companion/src/modeledit/telemetry.ui index df30da3fc..24ca7eb31 100644 --- a/companion/src/modeledit/telemetry.ui +++ b/companion/src/modeledit/telemetry.ui @@ -437,356 +437,6 @@ - - - - - 0 - 0 - - - - false - - - - 0 - - - 0 - - - 3 - - - 3 - - - - - - 0 - 0 - - - - - 0 - 0 - - - - Alarm 2 - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - Alarm 1 - - - - - - - - 75 - true - - - - RxBatt - - - - - - - false - - - - 0 - 0 - - - - - Critical Alarm - - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - Alarm 1 - - - - - - - - 0 - 0 - - - - - ---- - - - - - Yellow - - - - - Orange - - - - - Red - - - - - - - - true - - - - 0 - 0 - - - - - - - 20 - - - 80 - - - 1 - - - 50 - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - Alarm 2 - - - - - - - - 0 - 0 - - - - - ---- - - - - - Yellow - - - - - Orange - - - - - Red - - - - - - - - true - - - - 0 - 0 - - - - - - - 20 - - - 80 - - - 1 - - - 50 - - - - - - - - 75 - true - - - - RSSI - - - - - - - false - - - - 0 - 0 - - - - - Low Alarm - - - - - - - - Qt::Vertical - - - - 20 - 0 - - - - - - - - - 0 - 0 - - - - 2 - - - 0.000000000000000 - - - 13.199999999999999 - - - 0.050000000000000 - - - 4.300000000000000 - - - - - - - - 0 - 0 - - - - 2 - - - 0.000000000000000 - - - 13.199999999999999 - - - 0.051764000000000 - - - 4.300000000000000 - - - - - - @@ -1213,6 +863,216 @@ + + + + + 0 + 0 + + + + false + + + + 0 + + + 0 + + + 3 + + + 3 + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + Alarm 1 + + + + + + + + 0 + 0 + + + + + ---- + + + + + Yellow + + + + + Orange + + + + + Red + + + + + + + + true + + + + 0 + 0 + + + + + + + 20 + + + 80 + + + 1 + + + 50 + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Alarm 2 + + + + + + + + 0 + 0 + + + + + ---- + + + + + Yellow + + + + + Orange + + + + + Red + + + + + + + + true + + + + 0 + 0 + + + + + + + 20 + + + 80 + + + 1 + + + 50 + + + + + + + + 75 + true + + + + RSSI + + + + + + + Qt::Vertical + + + + 20 + 0 + + + + + + + diff --git a/radio/src/eeprom_conversions.cpp b/radio/src/eeprom_conversions.cpp index ecd8d1001..c6fea9d19 100644 --- a/radio/src/eeprom_conversions.cpp +++ b/radio/src/eeprom_conversions.cpp @@ -338,8 +338,8 @@ int ConvertTelemetrySource_215_to_216(int source) // TELEM_RSSI_TX added if (source >= TELEM_RSSI_TX) source += 1; - // RxBatt added - if (source >= TELEM_RXBATT) + // Reserve added + if (source >= TELEM_RESERVE0) source += 1; // A3 and A4 added if (source >= TELEM_A3) @@ -838,9 +838,6 @@ void ConvertModel_215_to_216(ModelData &model) memcpy(&g_model.frsky, &oldModel.frsky, 2*sizeof(FrSkyChannelData)); // gap for A3-A4 memcpy(((uint8_t *)&g_model.frsky) + 4*sizeof(FrSkyChannelData), ((uint8_t *)&oldModel.frsky) + 2*sizeof(FrSkyChannelData), sizeof(oldModel.frsky) - 2*sizeof(FrSkyChannelData)); - // RxBatt introduced - if (g_model.frsky.voltsSource >= FRSKY_VOLTS_SOURCE_A1) - g_model.frsky.voltsSource += 1; // A3 and A4 introduced if (g_model.frsky.voltsSource >= FRSKY_VOLTS_SOURCE_A3) g_model.frsky.voltsSource += 2; diff --git a/radio/src/gui/menu_model.cpp b/radio/src/gui/menu_model.cpp index 0164c447a..4f76f41a2 100644 --- a/radio/src/gui/menu_model.cpp +++ b/radio/src/gui/menu_model.cpp @@ -5361,11 +5361,6 @@ void menuModelCustomScripts(uint8_t event) enum menuModelTelemetryItems { CASE_CPUARM(ITEM_TELEMETRY_PROTOCOL_TYPE) -#if defined(CPUARM) - ITEM_TELEMETRY_RXBATT_LABEL, - ITEM_TELEMETRY_RXBATT_ALARM1, - ITEM_TELEMETRY_RXBATT_ALARM2, -#endif ITEM_TELEMETRY_A1_LABEL, ITEM_TELEMETRY_A1_RANGE, ITEM_TELEMETRY_A1_OFFSET, @@ -5463,12 +5458,6 @@ enum menuModelTelemetryItems { #define TELEM_SCRTYPE_COL (10*FW) #endif -#if defined(CPUARM) - #define RXBATT_ROWS LABEL(RXBATT), 0, 0, -#else - #define RXBATT_ROWS -#endif - #if defined(PCBTARANIS) #define CHANNEL_ROWS LABEL(CHANNEL), 1, 0, 0, 0 #define RSSI_ROWS LABEL(RSSI), 0, 0 @@ -5497,7 +5486,7 @@ enum menuModelTelemetryItems { void menuModelTelemetry(uint8_t event) { - MENU(STR_MENUTELEMETRY, menuTabModel, e_Telemetry, ITEM_TELEMETRY_MAX+1, {0, CASE_CPUARM(0) RXBATT_ROWS CHANNEL_ROWS, CHANNEL_ROWS, CASE_CPUARM(CHANNEL_ROWS) CASE_CPUARM(CHANNEL_ROWS) RSSI_ROWS, USRDATA_LINES 0, 0, IF_FAS_OFFSET(0) CASE_CPUARM(0) CASE_VARIO(LABEL(Vario)) CASE_VARIO(0) CASE_VARIO(VARIO_RANGE_ROWS) CASE_PCBTARANIS(LABEL(TopBar)) CASE_PCBTARANIS(0) SCREEN_TYPE_ROWS, 2, 2, 2, 2, SCREEN_TYPE_ROWS, 2, 2, 2, 2, CASE_CPUARM(SCREEN_TYPE_ROWS) CASE_CPUARM(2) CASE_CPUARM(2) CASE_CPUARM(2) CASE_CPUARM(2)}); + MENU(STR_MENUTELEMETRY, menuTabModel, e_Telemetry, ITEM_TELEMETRY_MAX+1, {0, CASE_CPUARM(0) CHANNEL_ROWS, CHANNEL_ROWS, CASE_CPUARM(CHANNEL_ROWS) CASE_CPUARM(CHANNEL_ROWS) RSSI_ROWS, USRDATA_LINES 0, 0, IF_FAS_OFFSET(0) CASE_CPUARM(0) CASE_VARIO(LABEL(Vario)) CASE_VARIO(0) CASE_VARIO(VARIO_RANGE_ROWS) CASE_PCBTARANIS(LABEL(TopBar)) CASE_PCBTARANIS(0) SCREEN_TYPE_ROWS, 2, 2, 2, 2, SCREEN_TYPE_ROWS, 2, 2, 2, 2, CASE_CPUARM(SCREEN_TYPE_ROWS) CASE_CPUARM(2) CASE_CPUARM(2) CASE_CPUARM(2) CASE_CPUARM(2)}); uint8_t sub = m_posVert - 1; @@ -5540,23 +5529,6 @@ void menuModelTelemetry(uint8_t event) break; #endif -#if defined(CPUARM) - case ITEM_TELEMETRY_RXBATT_LABEL: - lcd_putsLeft(y, "RxBatt"); - putsTelemetryChannel(TELEM_COL2+6*FW, y, TELEM_RXBATT-1, frskyData.analog[TELEM_ANA_RXBATT].value, LEFT); - break; - case ITEM_TELEMETRY_RXBATT_ALARM1: - case ITEM_TELEMETRY_RXBATT_ALARM2: - { - uint8_t alarm = (k==ITEM_TELEMETRY_RXBATT_ALARM1 ? 0 : 1); - lcd_putsLeft(y, (alarm==0 ? STR_LOWALARM : STR_CRITICALALARM)); - putsTelemetryChannel(TELEM_COL2, y, TELEM_RXBATT-1, g_model.rxBattAlarms[alarm], LEFT|attr); - if (attr && (s_editMode>0 || p1valdiff)) { - g_model.rxBattAlarms[alarm] = checkIncDec(event, g_model.rxBattAlarms[alarm], 0, 255, EE_MODEL); - } - break; - } -#endif case ITEM_TELEMETRY_A1_LABEL: case ITEM_TELEMETRY_A2_LABEL: #if defined(CPUARM) diff --git a/radio/src/gui/menus.cpp b/radio/src/gui/menus.cpp index aa3477b70..a573fc313 100644 --- a/radio/src/gui/menus.cpp +++ b/radio/src/gui/menus.cpp @@ -1451,6 +1451,9 @@ bool isTelemetrySourceAvailable(int source) return false; #endif + if (source == TELEM_RESERVE0) + return false; + if (source >= TELEM_RESERVE1 && source <= TELEM_RESERVE5) return false; diff --git a/radio/src/gui/view_main.cpp b/radio/src/gui/view_main.cpp index e96c42b5c..7da3010c8 100644 --- a/radio/src/gui/view_main.cpp +++ b/radio/src/gui/view_main.cpp @@ -252,11 +252,7 @@ void displayTopBar() /* Rx voltage */ lcdint_t voltage = 0; uint8_t channel = 0; - if (g_model.frsky.voltsSource == FRSKY_VOLTS_SOURCE_RXBATT) { - channel = TELEM_RXBATT-1; - voltage = frskyData.analog[TELEM_ANA_RXBATT].value; - } - else if (g_model.frsky.voltsSource <= FRSKY_VOLTS_SOURCE_A4) { + if (g_model.frsky.voltsSource <= FRSKY_VOLTS_SOURCE_A4) { channel = TELEM_A1+g_model.frsky.voltsSource-1; voltage = frskyData.analog[g_model.frsky.voltsSource].value; } diff --git a/radio/src/gui/view_telemetry.cpp b/radio/src/gui/view_telemetry.cpp index 516c58724..5c84fc3fd 100644 --- a/radio/src/gui/view_telemetry.cpp +++ b/radio/src/gui/view_telemetry.cpp @@ -347,11 +347,6 @@ void menuTelemetryFrsky(uint8_t event) lcd_putsiAtt(0, 2*FH, STR_AMPSRC, g_model.frsky.voltsSource+1, 0); #endif switch (g_model.frsky.voltsSource) { -#if defined(CPUARM) - case FRSKY_VOLTS_SOURCE_RXBATT: - putsTelemetryChannel(3*FW+6*FW+4, FH+1, TELEM_RXBATT-1, frskyData.analog[TELEM_ANA_RXBATT].value, DBLSIZE); - break; -#endif case FRSKY_VOLTS_SOURCE_A1: case FRSKY_VOLTS_SOURCE_A2: #if defined(CPUARM) diff --git a/radio/src/lcd.cpp b/radio/src/lcd.cpp index ac2c05004..98b69c797 100644 --- a/radio/src/lcd.cpp +++ b/radio/src/lcd.cpp @@ -1219,23 +1219,6 @@ void putsTelemetryChannel(xcoord_t x, uint8_t y, uint8_t channel, lcdint_t val, att &= ~NO_UNIT; putsTimer(x, y, val, att, att); break; -#if defined(CPUARM) - case TELEM_RXBATT-1: - val = ((val*1320) + 127) / 255; -#if LCD_W >= 212 - att |= PREC2; -#else - if (abs(val) < 1000) { - att |= PREC2; - } - else { - val = div10_and_round(val); - att |= PREC1; - } -#endif - putsTelemetryValue(x, y, val, UNIT_VOLTS, att); - break; -#endif #if defined(FRSKY) case TELEM_MIN_A1-1: case TELEM_MIN_A2-1: diff --git a/radio/src/mixer.cpp b/radio/src/mixer.cpp index 610e5ac6d..949d749f0 100755 --- a/radio/src/mixer.cpp +++ b/radio/src/mixer.cpp @@ -329,7 +329,6 @@ getvalue_t getValue(uint8_t i) #if defined(FRSKY) #if defined(CPUARM) else if (i==MIXSRC_FIRST_TELEM-1+TELEM_SWR) return frskyData.swr.value; - else if (i==MIXSRC_FIRST_TELEM-1+TELEM_RXBATT) return frskyData.analog[TELEM_ANA_RXBATT].value; #endif else if (i==MIXSRC_FIRST_TELEM-1+TELEM_RSSI_TX) return frskyData.rssi[1].value; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_RSSI_RX) return frskyData.rssi[0].value; diff --git a/radio/src/myeeprom.h b/radio/src/myeeprom.h index 2253003fc..22f41ed9c 100644 --- a/radio/src/myeeprom.h +++ b/radio/src/myeeprom.h @@ -326,7 +326,7 @@ PACK(typedef struct t_ScriptData { TRAINER_MODULE }; #define MODELDATA_BITMAP char bitmap[LEN_BITMAP_NAME]; - #define MODELDATA_EXTRA uint8_t externalModule; uint8_t trainerMode; ModuleData moduleData[NUM_MODULES+1]; char curveNames[MAX_CURVES][6]; ScriptData scriptsData[MAX_SCRIPTS]; char inputNames[MAX_INPUTS][4]; uint8_t nPotsToWarn; int8_t potPosition[NUM_POTS]; uint8_t rxBattAlarms[2]; + #define MODELDATA_EXTRA uint8_t externalModule; uint8_t trainerMode; ModuleData moduleData[NUM_MODULES+1]; char curveNames[MAX_CURVES][6]; ScriptData scriptsData[MAX_SCRIPTS]; char inputNames[MAX_INPUTS][4]; uint8_t nPotsToWarn; int8_t potPosition[NUM_POTS]; uint8_t spare[2]; #define LIMITDATA_EXTRA char name[LEN_CHANNEL_NAME]; int8_t curve; #define swstate_t uint16_t #elif defined(PCBSKY9X) @@ -1034,7 +1034,7 @@ enum TelemetrySource { TELEM_RSSI_TX, TELEM_RSSI_RX, #if defined(CPUARM) - TELEM_RXBATT, + TELEM_RESERVE0, #endif TELEM_A_FIRST, TELEM_A1=TELEM_A_FIRST, @@ -1184,9 +1184,6 @@ enum FrskyCurrentSource { }; enum FrskyVoltsSource { -#if defined(CPUARM) - FRSKY_VOLTS_SOURCE_RXBATT, -#endif FRSKY_VOLTS_SOURCE_A1, FRSKY_VOLTS_SOURCE_A2, #if defined(CPUARM) diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 0157c8142..30c28b957 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -439,8 +439,6 @@ void modelDefault(uint8_t id) #if defined(PCBTARANIS) g_model.frsky.channels[0].ratio = 132; - g_model.rxBattAlarms[0] = 0; - g_model.rxBattAlarms[1] = 83; // 4.3V #endif #if defined(MAVLINK) @@ -1656,11 +1654,6 @@ PLAY_FUNCTION(playValue, uint8_t idx) case MIXSRC_FIRST_TELEM+TELEM_SWR-1: PLAY_NUMBER(val, 0, 0); break; - case MIXSRC_FIRST_TELEM+TELEM_RXBATT-1: - if (TELEMETRY_STREAMING()) { - PLAY_NUMBER((val*132+127)/255, 1+UNIT_VOLTS, PREC1); - } - break; #endif #if defined(FRSKY) case MIXSRC_FIRST_TELEM+TELEM_RSSI_TX-1: diff --git a/radio/src/telemetry/frsky.cpp b/radio/src/telemetry/frsky.cpp index 9c9d6b776..72b824c06 100644 --- a/radio/src/telemetry/frsky.cpp +++ b/radio/src/telemetry/frsky.cpp @@ -134,10 +134,6 @@ lcdint_t applyChannelRatio(uint8_t channel, lcdint_t val) } #if defined(CPUARM) -inline bool rxBattAlarmRaised(uint8_t alarm) -{ - return g_model.rxBattAlarms[alarm] > 0 && frskyData.analog[TELEM_ANA_RXBATT].value < g_model.rxBattAlarms[alarm]; -} inline bool alarmRaised(uint8_t channel, uint8_t idx) { return g_model.frsky.channels[channel].ratio > 0 && g_model.frsky.channels[channel].alarms_value[idx] > 0 && frskyData.analog[channel].value < g_model.frsky.channels[channel].alarms_value[idx]; @@ -269,7 +265,6 @@ NOINLINE void processSerialData(uint8_t data) enum AlarmsCheckSteps { ALARM_SWR_STEP, ALARM_RSSI_STEP, - ALARM_RXBATT_STEP, ALARM_A1_STEP, ALARM_A2_STEP, ALARM_A3_STEP, @@ -359,16 +354,6 @@ void telemetryWakeup() alarmsCheckTime = get_tmr10ms() + 300; /* next check in 3 seconds */ } } - else if (alarmsCheckStep == ALARM_RXBATT_STEP) { - if (rxBattAlarmRaised(1)) { - AUDIO_RXBATT_RED(); - alarmsCheckTime = get_tmr10ms() + 300; /* next check in 3 seconds */ - } - else if (rxBattAlarmRaised(0)) { - AUDIO_RXBATT_ORANGE(); - alarmsCheckTime = get_tmr10ms() + 300; /* next check in 3 seconds */ - } - } else if (alarmsCheckStep == ALARM_A1_STEP) { if (alarmRaised(TELEM_ANA_A1, 1)) { AUDIO_A1_RED(); @@ -448,10 +433,7 @@ void telemetryInterrupt10ms() // power calculation uint8_t channel = g_model.frsky.voltsSource; #if defined(CPUARM) - if (channel == FRSKY_VOLTS_SOURCE_RXBATT) { - voltage = ((frskyData.analog[TELEM_ANA_RXBATT].value * 132) + 127) / 255; - } - else if (channel <= FRSKY_VOLTS_SOURCE_A4) { + if (channel <= FRSKY_VOLTS_SOURCE_A4) { voltage = applyChannelRatio(channel, frskyData.analog[channel].value) / 10; } #else diff --git a/radio/src/telemetry/frsky.h b/radio/src/telemetry/frsky.h index 3342949b1..8d2cfe692 100644 --- a/radio/src/telemetry/frsky.h +++ b/radio/src/telemetry/frsky.h @@ -298,7 +298,6 @@ enum TelemAnas { #if defined(CPUARM) TELEM_ANA_A3, TELEM_ANA_A4, - TELEM_ANA_RXBATT, #endif TELEM_ANA_COUNT }; diff --git a/radio/src/telemetry/frsky_sport.cpp b/radio/src/telemetry/frsky_sport.cpp index ef5c25ad8..b7728b71f 100644 --- a/radio/src/telemetry/frsky_sport.cpp +++ b/radio/src/telemetry/frsky_sport.cpp @@ -325,7 +325,7 @@ void frskySportProcessPacket(uint8_t *packet) #endif } else if (appId == BATT_ID) { - frskyData.analog[TELEM_ANA_RXBATT].set(SPORT_DATA_U8(packet), UNIT_VOLTS); + frskyData.analog[TELEM_ANA_A1].set(SPORT_DATA_U8(packet), UNIT_VOLTS); } else if ((appId >> 8) == 0) { // The old FrSky IDs diff --git a/radio/src/translations/cz.h.txt b/radio/src/translations/cz.h.txt index c7e69d288..e3ea8a81e 100644 --- a/radio/src/translations/cz.h.txt +++ b/radio/src/translations/cz.h.txt @@ -292,7 +292,7 @@ #define TR_TELEM_RESERVE TR("[--]", "[---]") #define TR_TELEM_TIME TR("Time", "Time\0") #define TR_SWR TR("SWR\0", "SWR\0 ") - #define TR_RX_BATT TR("RxBt", "RxBat") + #define TR_RX_BATT TR("[NA]", "[NA]\0") #define TR_A3_A4 TR("A3\0 ""A4\0 ", "A3\0 ""A4\0 ") #define TR_A3_A4_MIN TR("A3-\0""A4-\0", "A3-\0 ""A4-\0 ") #else @@ -358,7 +358,7 @@ #define LEN_AMPSRC TR("\003", "\007") #define TR_AMPSRC TR("---""A1\0""A2\0""A3\0""A4\0""FAS""Cel", "---\0 ""A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Cells\0 ") #define LEN_VOLTSRC TR("\003", "\007") - #define TR_VOLTSRC TR("RxV""A1\0""A2\0""A3\0""A4\0""FAS""Cel", "RxBatt\0""A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Cells\0 ") + #define TR_VOLTSRC TR("A1\0""A2\0""A3\0""A4\0""FAS""Cel", "A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Cells\0 ") #else #define LEN_AMPSRC TR("\003", "\007") #define TR_AMPSRC TR("---""A1\0""A2\0""FAS""Cel", "---\0 ""A1\0 ""A2\0 ""FAS\0 ""Cells\0 ") diff --git a/radio/src/translations/de.h.txt b/radio/src/translations/de.h.txt index bc15c9424..681630284 100644 --- a/radio/src/translations/de.h.txt +++ b/radio/src/translations/de.h.txt @@ -292,7 +292,7 @@ #define TR_TELEM_RESERVE TR("[--]", "[---]") #define TR_TELEM_TIME TR("Time", "Time\0") #define TR_SWR TR("SWR\0", "SWR\0 ") - #define TR_RX_BATT TR("RxBt", "RxBat") + #define TR_RX_BATT TR("[NA]", "[NA]\0") #define TR_A3_A4 TR("A3\0 ""A4\0 ", "A3\0 ""A4\0 ") #define TR_A3_A4_MIN TR("A3-\0""A4-\0", "A3-\0 ""A4-\0 ") #else @@ -358,7 +358,7 @@ #define LEN_AMPSRC TR("\003", "\007") #define TR_AMPSRC TR("---""A1\0""A2\0""A3\0""A4\0""FAS""Cel", "---\0 ""A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Cells\0 ") #define LEN_VOLTSRC TR("\003", "\007") - #define TR_VOLTSRC TR("RxV""A1\0""A2\0""A3\0""A4\0""FAS""Cel", "RxAkku\0""A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Cells\0 ") + #define TR_VOLTSRC TR("A1\0""A2\0""A3\0""A4\0""FAS""Cel", "A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Cells\0 ") #else #define LEN_AMPSRC TR("\003", "\007") #define TR_AMPSRC TR("---""A1\0""A2\0""FAS""Cel", "---\0 ""A1\0 ""A2\0 ""FAS\0 ""Cells\0 ") diff --git a/radio/src/translations/en.h.txt b/radio/src/translations/en.h.txt index 4445bae36..e9a4c45ec 100644 --- a/radio/src/translations/en.h.txt +++ b/radio/src/translations/en.h.txt @@ -292,7 +292,7 @@ #define TR_TELEM_RESERVE TR("[--]", "[---]") #define TR_TELEM_TIME TR("Time", "Time\0") #define TR_SWR TR("SWR\0", "SWR\0 ") - #define TR_RX_BATT TR("RxBt", "RxBat") + #define TR_RX_BATT TR("[NA]", "[NA]\0") #define TR_A3_A4 TR("A3\0 ""A4\0 ", "A3\0 ""A4\0 ") #define TR_A3_A4_MIN TR("A3-\0""A4-\0", "A3-\0 ""A4-\0 ") #else @@ -355,13 +355,13 @@ #define TR_VTELPROTO "None\0 ""Hub\0 ""WSHHigh" #if defined(CPUARM) - #define LEN_AMPSRC TR("\003", "\007") - #define TR_AMPSRC TR("---""A1\0""A2\0""A3\0""A4\0""FAS""Cel", "---\0 ""A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Cells\0 ") - #define LEN_VOLTSRC TR("\003", "\007") - #define TR_VOLTSRC TR("RxV""A1\0""A2\0""A3\0""A4\0""FAS""Cel", "RxBatt\0""A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Cells\0 ") + #define LEN_AMPSRC TR("\003", "\005") + #define TR_AMPSRC TR("---""A1\0""A2\0""A3\0""A4\0""FAS""Cel", "---\0 ""A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Cells") + #define LEN_VOLTSRC TR("\003", "\005") + #define TR_VOLTSRC TR("A1\0""A2\0""A3\0""A4\0""FAS""Cel", "A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Cells") #else - #define LEN_AMPSRC TR("\003", "\007") - #define TR_AMPSRC TR("---""A1\0""A2\0""FAS""Cel", "---\0 ""A1\0 ""A2\0 ""FAS\0 ""Cells\0 ") + #define LEN_AMPSRC TR("\003", "\005") + #define TR_AMPSRC TR("---""A1\0""A2\0""FAS""Cel", "---\0 ""A1\0 ""A2\0 ""FAS\0 ""Cells") #endif #define LEN_VARIOSRC "\004" diff --git a/radio/src/translations/es.h.txt b/radio/src/translations/es.h.txt index 449d2f8c8..e196126e8 100644 --- a/radio/src/translations/es.h.txt +++ b/radio/src/translations/es.h.txt @@ -292,7 +292,7 @@ #define TR_TELEM_RESERVE TR("[--]", "[---]") #define TR_TELEM_TIME TR("Time", "Time\0") #define TR_SWR TR("SWR\0", "SWR\0 ") - #define TR_RX_BATT TR("RxBt", "RxBat") + #define TR_RX_BATT TR("[NA]", "[NA]\0") #define TR_A3_A4 TR("A3\0 ""A4\0 ", "A3\0 ""A4\0 ") #define TR_A3_A4_MIN TR("A3-\0""A4-\0", "A3-\0 ""A4-\0 ") #else @@ -358,7 +358,7 @@ #define LEN_AMPSRC TR("\003", "\007") #define TR_AMPSRC TR("---""A1\0""A2\0""A3\0""A4\0""FAS""Cel", "---\0 ""A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Cells\0 ") #define LEN_VOLTSRC TR("\003", "\007") - #define TR_VOLTSRC TR("RxV""A1\0""A2\0""A3\0""A4\0""FAS""Cel", "RxBatt\0""A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Cells\0 ") + #define TR_VOLTSRC TR("A1\0""A2\0""A3\0""A4\0""FAS""Cel", "A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Cells\0 ") #else #define LEN_AMPSRC TR("\003", "\007") #define TR_AMPSRC TR("---""A1\0""A2\0""FAS""Cel", "---\0 ""A1\0 ""A2\0 ""FAS\0 ""Cells\0 ") diff --git a/radio/src/translations/fi.h.txt b/radio/src/translations/fi.h.txt index 3cb28e0e0..7b6e6cfb0 100644 --- a/radio/src/translations/fi.h.txt +++ b/radio/src/translations/fi.h.txt @@ -292,7 +292,7 @@ #define TR_TELEM_RESERVE TR("[--]", "[---]") #define TR_TELEM_TIME TR("Time", "Time\0") #define TR_SWR TR("SWR\0", "SWR\0 ") - #define TR_RX_BATT TR("RxBt", "RxBat") + #define TR_RX_BATT TR("[NA]", "[NA]\0") #define TR_A3_A4 TR("A3\0 ""A4\0 ", "A3\0 ""A4\0 ") #define TR_A3_A4_MIN TR("A3-\0""A4-\0", "A3-\0 ""A4-\0 ") #else @@ -358,7 +358,7 @@ #define LEN_AMPSRC TR("\003", "\007") #define TR_AMPSRC TR("---""A1\0""A2\0""A3\0""A4\0""FAS""Cel", "---\0 ""A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Cells\0 ") #define LEN_VOLTSRC TR("\003", "\007") - #define TR_VOLTSRC TR("RxV""A1\0""A2\0""A3\0""A4\0""FAS""Cel", "RxBatt\0""A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Cells\0 ") + #define TR_VOLTSRC TR("A1\0""A2\0""A3\0""A4\0""FAS""Cel", "A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Cells\0 ") #else #define LEN_AMPSRC TR("\003", "\007") #define TR_AMPSRC TR("---""A1\0""A2\0""FAS""Cel", "---\0 ""A1\0 ""A2\0 ""FAS\0 ""Cells\0 ") diff --git a/radio/src/translations/fr.h.txt b/radio/src/translations/fr.h.txt index 9cd7ebde2..150bd528f 100644 --- a/radio/src/translations/fr.h.txt +++ b/radio/src/translations/fr.h.txt @@ -355,13 +355,13 @@ #define TR_VTELPROTO "Aucun ""Hub\0 ""WSHHigh" #if defined(CPUARM) - #define LEN_AMPSRC TR("\003", "\007") - #define TR_AMPSRC TR("---""A1\0""A2\0""A3\0""A4\0""FAS""Cel", "---\0 ""A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Elem.\0 ") - #define LEN_VOLTSRC TR("\003", "\007") - #define TR_VOLTSRC TR("RxV""A1\0""A2\0""A3\0""A4\0""FAS""Cel", "RxBatt\0""A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Elem.\0 ") + #define LEN_AMPSRC TR("\003", "\005") + #define TR_AMPSRC TR("---""A1\0""A2\0""A3\0""A4\0""FAS""Cel", "---\0 ""A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Elem.") + #define LEN_VOLTSRC TR("\003", "\005") + #define TR_VOLTSRC TR("A1\0""A2\0""A3\0""A4\0""FAS""Cel", "A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Elem.") #else - #define LEN_AMPSRC TR("\003", "\007") - #define TR_AMPSRC TR("---""A1\0""A2\0""FAS""Cel", "---\0 ""A1\0 ""A2\0 ""FAS\0 ""Elem.\0 ") + #define LEN_AMPSRC TR("\003", "\005") + #define TR_AMPSRC TR("---""A1\0""A2\0""FAS""Cel", "---\0 ""A1\0 ""A2\0 ""FAS\0 ""Elem.") #endif #define LEN_VARIOSRC "\005" diff --git a/radio/src/translations/it.h.txt b/radio/src/translations/it.h.txt index eaf2bd8a9..4a9fd176d 100644 --- a/radio/src/translations/it.h.txt +++ b/radio/src/translations/it.h.txt @@ -358,7 +358,7 @@ #define LEN_AMPSRC TR("\003", "\007") #define TR_AMPSRC TR("---""A1\0""A2\0""A3\0""A4\0""FAS""Cel", "---\0 ""A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Celle\0 ") #define LEN_VOLTSRC TR("\003", "\007") - #define TR_VOLTSRC TR("RxV""A1\0""A2\0""A3\0""A4\0""FAS""Cel", "BattRx\0""A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Celle\0 ") + #define TR_VOLTSRC TR("A1\0""A2\0""A3\0""A4\0""FAS""Cel", "A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Celle\0 ") #else #define LEN_AMPSRC TR("\003", "\007") #define TR_AMPSRC TR("---""A1\0""A2\0""FAS""Cel", "---\0 ""A1\0 ""A2\0 ""FAS\0 ""Celle\0 ") diff --git a/radio/src/translations/pl.h.txt b/radio/src/translations/pl.h.txt index d7f659161..99471de2b 100644 --- a/radio/src/translations/pl.h.txt +++ b/radio/src/translations/pl.h.txt @@ -292,7 +292,7 @@ #define TR_TELEM_RESERVE TR("[--]", "[---]") #define TR_TELEM_TIME TR("Time", "Time\0") #define TR_SWR TR("SWR\0", "SWR\0 ") - #define TR_RX_BATT TR("RxBt", "RxBat") + #define TR_RX_BATT TR("[NA]", "[NA]\0") #define TR_A3_A4 TR("A3\0 ""A4\0 ", "A3\0 ""A4\0 ") #define TR_A3_A4_MIN TR("A3-\0""A4-\0", "A3-\0 ""A4-\0 ") #else @@ -358,7 +358,7 @@ #define LEN_AMPSRC TR("\003", "\007") #define TR_AMPSRC TR("---""A1\0""A2\0""A3\0""A4\0""FAS""Cel", "---\0 ""A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Cells\0 ") #define LEN_VOLTSRC TR("\003", "\007") - #define TR_VOLTSRC TR("RxV""A1\0""A2\0""A3\0""A4\0""FAS""Cel", "RxBatt\0""A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Cells\0 ") + #define TR_VOLTSRC TR("A1\0""A2\0""A3\0""A4\0""FAS""Cel", "A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Cells\0 ") #else #define LEN_AMPSRC TR("\003", "\007") #define TR_AMPSRC TR("---""A1\0""A2\0""FAS""Cel", "---\0 ""A1\0 ""A2\0 ""FAS\0 ""Cells\0 ") diff --git a/radio/src/translations/pt.h.txt b/radio/src/translations/pt.h.txt index 202402ebd..4c04712c6 100644 --- a/radio/src/translations/pt.h.txt +++ b/radio/src/translations/pt.h.txt @@ -292,7 +292,7 @@ #define TR_TELEM_RESERVE TR("[--]", "[---]") #define TR_TELEM_TIME TR("Time", "Time\0") #define TR_SWR TR("SWR\0", "SWR\0 ") - #define TR_RX_BATT TR("RxBt", "RxBat") + #define TR_RX_BATT TR("[NA]", "[NA]\0") #define TR_A3_A4 TR("A3\0 ""A4\0 ", "A3\0 ""A4\0 ") #define TR_A3_A4_MIN TR("A3-\0""A4-\0", "A3-\0 ""A4-\0 ") #else @@ -358,7 +358,7 @@ #define LEN_AMPSRC TR("\003", "\007") #define TR_AMPSRC TR("---""A1\0""A2\0""A3\0""A4\0""FAS""Cel", "---\0 ""A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Cells\0 ") #define LEN_VOLTSRC TR("\003", "\007") - #define TR_VOLTSRC TR("RxV""A1\0""A2\0""A3\0""A4\0""FAS""Cel", "RxBatt\0""A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Cells\0 ") + #define TR_VOLTSRC TR("A1\0""A2\0""A3\0""A4\0""FAS""Cel", "A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Cells\0 ") #else #define LEN_AMPSRC TR("\003", "\007") #define TR_AMPSRC TR("---""A1\0""A2\0""FAS""Cel", "---\0 ""A1\0 ""A2\0 ""FAS\0 ""Cells\0 ") diff --git a/radio/src/translations/se.h.txt b/radio/src/translations/se.h.txt index 9a69abb83..723e67a58 100644 --- a/radio/src/translations/se.h.txt +++ b/radio/src/translations/se.h.txt @@ -292,7 +292,7 @@ #define TR_TELEM_RESERVE TR("[--]", "[---]") #define TR_TELEM_TIME TR("Tid\0", "Tid\0 ") #define TR_SWR TR("SWR\0", "SWR\0 ") - #define TR_RX_BATT TR("RxBt", "RxBat") + #define TR_RX_BATT TR("[NA]", "[NA]\0") #define TR_A3_A4 TR("A3\0 ""A4\0 ", "A3\0 ""A4\0 ") #define TR_A3_A4_MIN TR("A3-\0""A4-\0", "A3-\0 ""A4-\0 ") #else @@ -358,7 +358,7 @@ #define LEN_AMPSRC TR("\003", "\007") #define TR_AMPSRC TR("---""A1\0""A2\0""A3\0""A4\0""FAS""Cel", "---\0 ""A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Cells\0 ") #define LEN_VOLTSRC TR("\003", "\007") - #define TR_VOLTSRC TR("RxV""A1\0""A2\0""A3\0""A4\0""FAS""Cel", "RxBatt\0""A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Cells\0 ") + #define TR_VOLTSRC TR("A1\0""A2\0""A3\0""A4\0""FAS""Cel", "A1\0 ""A2\0 ""A3\0 ""A4\0 ""FAS\0 ""Cells\0 ") #else #define LEN_AMPSRC TR("\003", "\007") #define TR_AMPSRC TR("---""A1\0""A2\0""FAS""Cel", "---\0 ""A1\0 ""A2\0 ""FAS\0 ""Cells\0 ")