chore(dsmp): separate DSMP and DSM2, cleanup code, add DSMP status display and Enable AETR option (#6932)

Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
Peter Feerick
2026-01-21 09:01:49 +10:00
parent 35f943e3f5
commit a7f2e619ca
69 changed files with 1056 additions and 360 deletions
+16 -2
View File
@@ -54,6 +54,7 @@
#define MASK_AFHDS (1<<22)
#define MASK_CSRF_ARMING_MODE (1<<23)
#define MASK_CSRF_ARMING_TRIGGER (1<<24)
#define MASK_ENABLE_AETR (1<<25)
quint8 ModulePanel::failsafesValueDisplayType = ModulePanel::FAILSAFE_DISPLAY_PERCENT;
@@ -409,7 +410,7 @@ void ModulePanel::update()
mask |= MASK_CHANNELS_RANGE| MASK_CHANNELS_COUNT | MASK_FAILSAFES | MASK_AFHDS;
break;
case PULSES_LEMON_DSMP:
mask |= MASK_CHANNELS_RANGE;
mask |= MASK_CHANNELS_RANGE | MASK_ENABLE_AETR;
break;
default:
break;
@@ -448,6 +449,8 @@ void ModulePanel::update()
ui->channelsCount->setMaximum(module.getMaxChannelCount());
ui->channelsCount->setValue(module.channelsCount);
ui->channelsCount->setSingleStep(firmware->getCapability(HasPPMStart) ? 1 : 2);
// CRSF
ui->label_crsfArmingMode->setVisible(mask & MASK_CSRF_ARMING_MODE);
ui->crsfArmingMode->setVisible(mask & MASK_CSRF_ARMING_MODE);
ui->crsfArmingTrigger->setVisible(mask & MASK_CSRF_ARMING_TRIGGER);
@@ -611,6 +614,12 @@ void ModulePanel::update()
ui->raw12bits->setChecked(module.ghost.raw12bits);
}
// DSMP settings fields
ui->enableAETR->setVisible(mask & MASK_ENABLE_AETR);
if (mask & MASK_ENABLE_AETR) {
ui->enableAETR->setChecked(module.dsmp.enableAETR);
}
if (mask & MASK_ACCESS) {
ui->rx1->setText(module.access.receiverName[0]);
ui->rx2->setText(module.access.receiverName[1]);
@@ -632,7 +641,7 @@ void ModulePanel::update()
ui->clearRx3->setVisible((mask & MASK_ACCESS) && (module.access.receivers & (1 << 2)));
ui->rx3->setVisible((mask & MASK_ACCESS) && (module.access.receivers & (1 << 2)));
// AFHFS
// AFHDS2A / AFHDS3
if (mask & MASK_AFHDS) {
if (protocol == PULSES_FLYSKY_AFHDS2A) {
ui->label_afhds->setText(tr("Options"));
@@ -915,6 +924,11 @@ void ModulePanel::on_raw12bits_stateChanged(int state)
module.ghost.raw12bits = (state == Qt::Checked);
}
void ModulePanel::on_enableAETR_stateChanged(int state)
{
module.dsmp.enableAETR = (state == Qt::Checked);
}
void ModulePanel::on_racingMode_stateChanged(int state)
{
module.access.racingMode = (state == Qt::Checked);
+1
View File
@@ -70,6 +70,7 @@ class ModulePanel : public ModelPanel
void on_autoBind_stateChanged(int state);
void on_disableChMap_stateChanged(int state);
void on_raw12bits_stateChanged(int state);
void on_enableAETR_stateChanged(int state);
void on_racingMode_stateChanged(int state);
void on_disableTelem_stateChanged(int state);
void on_lowPower_stateChanged(int state);
+10 -3
View File
@@ -399,7 +399,7 @@
</property>
</widget>
</item>
<item row="16" column="0" colspan="2">
<item row="17" column="0" colspan="2">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -429,14 +429,14 @@
</item>
</layout>
</item>
<item row="15" column="0">
<item row="16" column="0">
<widget class="QLabel" name="label_crsfArmingMode">
<property name="text">
<string>Arm using</string>
</property>
</widget>
</item>
<item row="15" column="1">
<item row="16" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_crsfarm">
<item>
<widget class="QComboBox" name="crsfArmingMode"/>
@@ -446,6 +446,13 @@
</item>
</layout>
</item>
<item row="15" column="1">
<widget class="QCheckBox" name="enableAETR">
<property name="text">
<string>Enable AETR</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">