1
0
Fork 0
mirror of https://github.com/EdgeTX/edgetx.git synced 2025-07-19 14:25:09 +03:00

Allow disabling RTC batt check (#6861)

Allow disabling RTC batt check
This commit is contained in:
3djc 2019-09-30 15:55:03 +02:00 committed by Bertrand Songis
parent c5f13b1a17
commit af5f3586f2
22 changed files with 200 additions and 139 deletions

View file

@ -140,6 +140,7 @@ class GeneralSettings {
unsigned int rotarySteps;
unsigned int countryCode;
bool jitterFilter;
bool rtcCheckDisable;
unsigned int imperial;
char ttsLanguage[2+1];
int beepVolume;

View file

@ -2571,7 +2571,8 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type
internalField.Append(new SignedField<2>(this, generalData.antennaMode));
else
internalField.Append(new SpareBitsField<2>(this));
internalField.Append(new SpareBitsField<3>(this));
internalField.Append(new BoolField<1>(this, generalData.rtcCheckDisable));
internalField.Append(new SpareBitsField<2>(this));
for (int i=0; i<4; i++) {
internalField.Append(new SignedField<16>(this, generalData.trainer.calib[i]));

View file

@ -200,6 +200,15 @@ HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings
}
else {
ui->filterEnable->hide();
ui->filterLabel->hide();
}
if (IS_STM32(board)) {
ui->rtcCheckDisable->setChecked(!generalSettings.rtcCheckDisable);
}
else {
ui->rtcCheckDisable->hide();
ui->rtcCheckLabel->hide();
}
disableMouseScrolling();
@ -217,6 +226,11 @@ void HardwarePanel::on_filterEnable_stateChanged()
generalSettings.jitterFilter = !ui->filterEnable->isChecked();
}
void HardwarePanel::on_rtcCheckDisable_stateChanged()
{
generalSettings.rtcCheckDisable = !ui->rtcCheckDisable->isChecked();
}
void HardwarePanel::on_PPM_MultiplierDSB_editingFinished()
{
int val = (int)(ui->PPM_MultiplierDSB->value()*10)-10;

View file

@ -49,6 +49,7 @@ class HardwarePanel : public GeneralPanel
void on_txCurrentCalibration_editingFinished();
void on_txVoltageCalibration_editingFinished();
void on_filterEnable_stateChanged();
void on_rtcCheckDisable_stateChanged();
void on_serialPortMode_currentIndexChanged(int index);

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>470</width>
<height>1585</height>
<height>1618</height>
</rect>
</property>
<property name="sizePolicy">
@ -57,7 +57,7 @@
</property>
</widget>
</item>
<item row="43" column="1">
<item row="44" column="1">
<widget class="QSpinBox" name="PPM2">
<property name="toolTip">
<string/>
@ -169,7 +169,7 @@
</property>
</widget>
</item>
<item row="39" column="1">
<item row="40" column="1">
<widget class="QSpinBox" name="txCurrentCalibration">
<property name="minimum">
<number>-49</number>
@ -192,27 +192,7 @@
</property>
</widget>
</item>
<item row="12" column="0">
<widget class="QLabel" name="rs2Label">
<property name="text">
<string>RS2</string>
</property>
</widget>
</item>
<item row="40" column="0" colspan="3">
<widget class="Line" name="ppmSeparator">
<property name="minimumSize">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="44" column="1">
<item row="45" column="1">
<widget class="QSpinBox" name="PPM3">
<property name="toolTip">
<string/>
@ -231,6 +211,26 @@
</property>
</widget>
</item>
<item row="41" column="0" colspan="3">
<widget class="Line" name="ppmSeparator">
<property name="minimumSize">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="12" column="0">
<widget class="QLabel" name="rs2Label">
<property name="text">
<string>RS2</string>
</property>
</widget>
</item>
<item row="13" column="0" colspan="3">
<widget class="Line" name="potsTypeSeparator_1">
<property name="minimumSize">
@ -267,7 +267,7 @@
</property>
</widget>
</item>
<item row="39" column="0">
<item row="40" column="0">
<widget class="QLabel" name="txCurrentCalibrationLabel">
<property name="text">
<string>Current Offset</string>
@ -284,7 +284,7 @@
</property>
</widget>
</item>
<item row="43" column="0">
<item row="44" column="0">
<widget class="QLabel" name="label_33">
<property name="text">
<string>PPM 2</string>
@ -312,6 +312,9 @@
</property>
</widget>
</item>
<item row="34" column="1">
<widget class="AutoComboBox" name="antennaMode"/>
</item>
<item row="19" column="1">
<widget class="AutoLineEdit" name="sfName">
<property name="maxLength">
@ -322,6 +325,19 @@
<item row="8" column="2">
<widget class="AutoComboBox" name="pot5Type"/>
</item>
<item row="20" column="2">
<widget class="AutoComboBox" name="sgType">
<property name="toolTip">
<string/>
</property>
<property name="statusTip">
<string/>
</property>
<property name="whatsThis">
<string/>
</property>
</widget>
</item>
<item row="21" column="2">
<widget class="AutoComboBox" name="shType">
<property name="toolTip">
@ -342,17 +358,14 @@
</property>
</widget>
</item>
<item row="20" column="2">
<widget class="AutoComboBox" name="sgType">
<item row="14" column="2">
<widget class="AutoComboBox" name="saType">
<property name="toolTip">
<string/>
</property>
<property name="statusTip">
<string/>
</property>
<property name="whatsThis">
<string/>
</property>
</widget>
</item>
<item row="18" column="2">
@ -375,16 +388,6 @@
</property>
</widget>
</item>
<item row="14" column="2">
<widget class="AutoComboBox" name="saType">
<property name="toolTip">
<string/>
</property>
<property name="statusTip">
<string/>
</property>
</widget>
</item>
<item row="14" column="0">
<widget class="QLabel" name="saLabel">
<property name="text">
@ -434,6 +437,16 @@
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="AutoComboBox" name="pot2Type">
<property name="toolTip">
<string/>
</property>
<property name="statusTip">
<string/>
</property>
</widget>
</item>
<item row="29" column="2">
<widget class="AutoComboBox" name="spType">
<property name="toolTip">
@ -447,23 +460,6 @@
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="AutoLineEdit" name="rsName">
<property name="maxLength">
<number>3</number>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="AutoComboBox" name="pot2Type">
<property name="toolTip">
<string/>
</property>
<property name="statusTip">
<string/>
</property>
</widget>
</item>
<item row="35" column="1">
<widget class="QCheckBox" name="filterEnable">
<property name="text">
@ -471,6 +467,13 @@
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="AutoLineEdit" name="rsName">
<property name="maxLength">
<number>3</number>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="AutoLineEdit" name="rudName">
<property name="maxLength">
@ -512,7 +515,7 @@
</property>
</widget>
</item>
<item row="46" column="1">
<item row="47" column="1">
<widget class="QDoubleSpinBox" name="PPM_MultiplierDSB">
<property name="decimals">
<number>1</number>
@ -545,6 +548,19 @@
</property>
</widget>
</item>
<item row="31" column="2">
<widget class="AutoComboBox" name="srType">
<property name="toolTip">
<string/>
</property>
<property name="statusTip">
<string/>
</property>
<property name="whatsThis">
<string/>
</property>
</widget>
</item>
<item row="38" column="0">
<widget class="QLabel" name="txVoltageCalibrationLabel">
<property name="text">
@ -562,19 +578,6 @@
</property>
</widget>
</item>
<item row="31" column="2">
<widget class="AutoComboBox" name="srType">
<property name="toolTip">
<string/>
</property>
<property name="statusTip">
<string/>
</property>
<property name="whatsThis">
<string/>
</property>
</widget>
</item>
<item row="20" column="0">
<widget class="QLabel" name="sgLabel">
<property name="text">
@ -589,9 +592,6 @@
</property>
</widget>
</item>
<item row="34" column="1">
<widget class="AutoComboBox" name="antennaMode"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="eleLabel">
<property name="text">
@ -599,6 +599,13 @@
</property>
</widget>
</item>
<item row="22" column="0">
<widget class="QLabel" name="siLabel">
<property name="text">
<string>SI</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="AutoLineEdit" name="pot4Name">
<property name="maxLength">
@ -613,10 +620,10 @@
</property>
</widget>
</item>
<item row="22" column="0">
<widget class="QLabel" name="siLabel">
<item row="25" column="0">
<widget class="QLabel" name="slLabel">
<property name="text">
<string>SI</string>
<string>SL</string>
</property>
</widget>
</item>
@ -627,13 +634,6 @@
</property>
</widget>
</item>
<item row="25" column="0">
<widget class="QLabel" name="slLabel">
<property name="text">
<string>SL</string>
</property>
</widget>
</item>
<item row="27" column="1">
<widget class="AutoLineEdit" name="snName">
<property name="maxLength">
@ -688,7 +688,7 @@
</property>
</widget>
</item>
<item row="45" column="1">
<item row="46" column="1">
<widget class="QSpinBox" name="PPM4">
<property name="toolTip">
<string/>
@ -707,7 +707,7 @@
</property>
</widget>
</item>
<item row="41" column="0">
<item row="42" column="0">
<widget class="QLabel" name="label_23">
<property name="text">
<string>PPM 1</string>
@ -727,14 +727,14 @@
</property>
</widget>
</item>
<item row="45" column="0">
<item row="46" column="0">
<widget class="QLabel" name="label_35">
<property name="text">
<string>PPM 4</string>
</property>
</widget>
</item>
<item row="41" column="1">
<item row="42" column="1">
<widget class="QSpinBox" name="PPM1">
<property name="toolTip">
<string/>
@ -766,6 +766,20 @@
</property>
</widget>
</item>
<item row="15" column="0">
<widget class="QLabel" name="sbLabel">
<property name="text">
<string>SB</string>
</property>
</widget>
</item>
<item row="31" column="1">
<widget class="AutoLineEdit" name="srName">
<property name="maxLength">
<number>3</number>
</property>
</widget>
</item>
<item row="38" column="1">
<widget class="QDoubleSpinBox" name="txVoltageCalibration">
<property name="statusTip">
@ -788,21 +802,7 @@
</property>
</widget>
</item>
<item row="15" column="0">
<widget class="QLabel" name="sbLabel">
<property name="text">
<string>SB</string>
</property>
</widget>
</item>
<item row="31" column="1">
<widget class="AutoLineEdit" name="srName">
<property name="maxLength">
<number>3</number>
</property>
</widget>
</item>
<item row="46" column="0">
<item row="47" column="0">
<widget class="QLabel" name="label_30">
<property name="text">
<string>PPM Multiplier</string>
@ -903,16 +903,6 @@
</property>
</widget>
</item>
<item row="34" column="0">
<widget class="QLabel" name="antennaLabel">
<property name="text">
<string>Antenna</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="27" column="2">
<widget class="AutoComboBox" name="snType">
<property name="toolTip">
@ -933,7 +923,17 @@
</property>
</widget>
</item>
<item row="44" column="0">
<item row="34" column="0">
<widget class="QLabel" name="antennaLabel">
<property name="text">
<string>Antenna</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="45" column="0">
<widget class="QLabel" name="label_34">
<property name="text">
<string>PPM 3</string>
@ -1029,6 +1029,26 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="AutoLineEdit" name="eleName">
<property name="maxLength">
<number>3</number>
</property>
</widget>
</item>
<item row="26" column="2">
<widget class="AutoComboBox" name="smType">
<property name="toolTip">
<string/>
</property>
<property name="statusTip">
<string/>
</property>
<property name="whatsThis">
<string/>
</property>
</widget>
</item>
<item row="36" column="1">
<widget class="QComboBox" name="serialPortMode">
<item>
@ -1058,26 +1078,6 @@
</item>
</widget>
</item>
<item row="1" column="1">
<widget class="AutoLineEdit" name="eleName">
<property name="maxLength">
<number>3</number>
</property>
</widget>
</item>
<item row="26" column="2">
<widget class="AutoComboBox" name="smType">
<property name="toolTip">
<string/>
</property>
<property name="statusTip">
<string/>
</property>
<property name="whatsThis">
<string/>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="rsLabel">
<property name="text">
@ -1113,6 +1113,20 @@
</property>
</widget>
</item>
<item row="39" column="1">
<widget class="QCheckBox" name="rtcCheckDisable">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="39" column="0">
<widget class="QLabel" name="rtcCheckLabel">
<property name="text">
<string>RTC Batt Check</string>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>

View file

@ -735,7 +735,8 @@ PACK(struct RadioData {
NOBACKUP(int8_t txVoltageCalibration);
uint8_t backlightMode:3;
int8_t antennaMode:2;
int8_t spare1:3;
uint8_t disableRtcWarning:1;
int8_t spare1:2;
NOBACKUP(TrainerData trainer);
NOBACKUP(uint8_t view); // index of view in main screen
NOBACKUP(BUZZER_FIELD); /* 2bits */

View file

@ -54,6 +54,7 @@ enum MenuRadioHardwareItems {
ITEM_RADIO_HARDWARE_SJ, // Gimbal switch right
ITEM_RADIO_HARDWARE_BATTERY_CALIB,
ITEM_RADIO_HARDWARE_RTC_BATTERY,
ITEM_RADIO_HARDWARE_RTC_CHECK,
ITEM_RADIO_HARDWARE_SERIAL_BAUDRATE,
ITEM_RADIO_HARDWARE_BLUETOOTH_MODE,
ITEM_RADIO_HARDWARE_BLUETOOTH_PAIRING_CODE,
@ -118,6 +119,7 @@ bool menuRadioHardware(event_t event)
0, /* battery */
READONLY_ROW, /* RTC */
0, /* RTC check */
0, /* max baudrate */
@ -271,6 +273,14 @@ bool menuRadioHardware(event_t event)
}
break;
case ITEM_RADIO_HARDWARE_RTC_CHECK:
{
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_RTC_CHECK);
uint8_t b = 1 - g_eeGeneral.disableRtcWarning;
g_eeGeneral.disableRtcWarning = 1 - editCheckBox(b, HW_SETTINGS_COLUMN + 50, y, attr, event);
break;
}
case ITEM_RADIO_HARDWARE_BLUETOOTH_MODE:
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_BLUETOOTH);
g_eeGeneral.bluetoothMode = editChoice(HW_SETTINGS_COLUMN+50, y, STR_BLUETOOTH_MODES, g_eeGeneral.bluetoothMode, BLUETOOTH_OFF, BLUETOOTH_TRAINER, attr, event);

View file

@ -151,6 +151,7 @@ enum {
#if defined(STM32)
ITEM_RADIO_HARDWARE_RTC_BATTERY,
ITEM_RADIO_HARDWARE_RTC_CHECK,
#endif
#if defined(TX_CAPACITY_MEASUREMENT)
@ -255,7 +256,7 @@ void onHardwareAntennaSwitchConfirm(const char * result)
#endif
#if defined(STM32)
#define RTC_ROW READONLY_ROW,
#define RTC_ROW READONLY_ROW, 0,
#else
#define RTC_ROW
#endif
@ -510,6 +511,10 @@ void menuRadioHardware(event_t event)
lcdDrawTextAlignedLeft(y, STR_RTC_BATT);
putsVolts(HW_SETTINGS_COLUMN2, y, getRTCBatteryVoltage(), PREC2|LEFT);
break;
case ITEM_RADIO_HARDWARE_RTC_CHECK:
g_eeGeneral.disableRtcWarning = 1 - editCheckBox(1 - g_eeGeneral.disableRtcWarning, HW_SETTINGS_COLUMN2, y, STR_RTC_CHECK, attr, event);
break;
#endif
#if defined(TX_CAPACITY_MEASUREMENT)

View file

@ -912,6 +912,7 @@ void checkAll()
#endif
#if defined(STM32)
if (!g_eeGeneral.disableRtcWarning)
checkRTCBattery();
#endif

View file

@ -572,6 +572,7 @@ const char STR_MENU_DISPLAY[] = TR_MENU_DISPLAY;
const char STR_MENU_OTHER[] = TR_MENU_OTHER;
const char STR_MENU_INVERT[] = TR_MENU_INVERT;
const char STR_JITTER_FILTER[] = TR_JITTER_FILTER;
const char STR_RTC_CHECK[] = TR_RTC_CHECK;
const char STR_EXIT[] = TR_EXIT;
const char STR_MODULE_RANGE[] = TR_MODULE_RANGE;
const char STR_RECEIVER_OPTIONS[] = TR_RECEIVER_OPTIONS;

View file

@ -851,6 +851,7 @@ extern const char STR_MENU_DISPLAY[];
extern const char STR_MENU_OTHER[];
extern const char STR_MENU_INVERT[];
extern const char STR_JITTER_FILTER[];
extern const char STR_RTC_CHECK[];
#if MENUS_LOCK == 1
extern const char STR_UNLOCKED[];

View file

@ -1145,6 +1145,7 @@
#define TR_MENU_OTHER "Ostatní"
#define TR_MENU_INVERT "Invertovat"
#define TR_JITTER_FILTER "ADC Filtr"
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
#define ZSTR_RSSI "RSSI"
#define ZSTR_R9PW "R9PW"

View file

@ -1150,6 +1150,7 @@
#define TR_MENU_OTHER "Weitere"
#define TR_MENU_INVERT "Invertieren<!>"
#define TR_JITTER_FILTER "ADC Filter"
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
// ----------------------------------------------------------------
#define ZSTR_RSSI "RSSI"
#define ZSTR_R9PW "R9PW"

View file

@ -1149,6 +1149,7 @@
#define TR_MENU_OTHER "Other"
#define TR_MENU_INVERT "Invert"
#define TR_JITTER_FILTER "ADC filter"
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
#define ZSTR_RSSI "RSSI"
#define ZSTR_R9PW "R9PW"

View file

@ -1170,6 +1170,7 @@
#define TR_MENU_OTHER "Other"
#define TR_MENU_INVERT "Invert"
#define TR_JITTER_FILTER "ADC Filter"
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
#define ZSTR_RSSI "RSSI"
#define ZSTR_R9PW "R9PW"

View file

@ -1158,6 +1158,7 @@
#define TR_MENU_OTHER "Other"
#define TR_MENU_INVERT "Invert"
#define TR_JITTER_FILTER "ADC Filter"
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
#define ZSTR_RSSI "RSSI"
#define ZSTR_R9PW "R9PW"

View file

@ -1173,6 +1173,7 @@
#define TR_MENU_OTHER "Autres"
#define TR_MENU_INVERT "Inverser"
#define TR_JITTER_FILTER "Filtre ADC"
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
#define ZSTR_RSSI "RSSI"
#define ZSTR_R9PW "R9PW"

View file

@ -1166,6 +1166,7 @@
#define TR_MENU_OTHER "Altro"
#define TR_MENU_INVERT "Inverti"
#define TR_JITTER_FILTER "ADC Filter"
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
#define ZSTR_RSSI "RSSI"
#define ZSTR_R9PW "R9PW"

View file

@ -1160,6 +1160,7 @@ TR_GYR_VSRCRAW
#define TR_MENU_OTHER "Verdere"
#define TR_MENU_INVERT "Inverteer"
#define TR_JITTER_FILTER "ADC Filter"
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
#define ZSTR_RSSI "RSSI"
#define ZSTR_R9PW "R9PW"

View file

@ -1166,6 +1166,7 @@
#define TR_MENU_OTHER "Inny "
#define TR_MENU_INVERT "Odwróć"
#define TR_JITTER_FILTER "ADC Filter"
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
#define ZSTR_RSSI "RSSI"
#define ZSTR_R9PW "R9PW"

View file

@ -1155,6 +1155,7 @@
#define TR_MENU_OTHER "Other"
#define TR_MENU_INVERT "Invert"
#define TR_JITTER_FILTER "ADC Filter"
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
#define ZSTR_RSSI "RSSI"
#define ZSTR_R9PW "R9PW"

View file

@ -1166,6 +1166,7 @@
#define TR_MENU_OTHER "Annat"
#define TR_MENU_INVERT "Invertera"
#define TR_JITTER_FILTER "ADC Filter"
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
#define ZSTR_RSSI "RSSI"
#define ZSTR_R9PW "R9PW"