Re #2239: PPM output type added for 9XR-PRO (open drain or push-pull)

This commit is contained in:
Damjan Adamic
2015-05-04 20:35:29 +02:00
parent 1609b1236d
commit 60b2a378dd
20 changed files with 198 additions and 25 deletions
+13
View File
@@ -204,6 +204,7 @@ ModulePanel::~ModulePanel()
#define MASK_CHANNELS_RANGE 8
#define MASK_PPM_FIELDS 16
#define MASK_FAILSAFES 32
#define MASK_OPEN_DRAIN 64
void ModulePanel::update()
{
@@ -230,6 +231,9 @@ void ModulePanel::update()
break;
case PPM:
mask |= MASK_PPM_FIELDS | MASK_CHANNELS_RANGE| MASK_CHANNELS_COUNT;
if (IS_9XRPRO(firmware->getBoard())) {
mask |= MASK_OPEN_DRAIN;
}
break;
case OFF:
default:
@@ -259,6 +263,9 @@ void ModulePanel::update()
ui->label_ppmPolarity->setVisible(mask & MASK_PPM_FIELDS);
ui->ppmPolarity->setVisible(mask & MASK_PPM_FIELDS);
ui->ppmPolarity->setCurrentIndex(module.ppmPulsePol);
ui->label_ppmOutputType->setVisible(mask & MASK_OPEN_DRAIN);
ui->ppmOutputType->setVisible(mask & MASK_OPEN_DRAIN);
ui->ppmOutputType->setCurrentIndex(module.ppmOutputType);
ui->label_ppmDelay->setVisible(mask & MASK_PPM_FIELDS);
ui->ppmDelay->setVisible(mask & MASK_PPM_FIELDS);
ui->ppmDelay->setValue(module.ppmDelay);
@@ -306,6 +313,12 @@ void ModulePanel::on_ppmPolarity_currentIndexChanged(int index)
emit modified();
}
void ModulePanel::on_ppmOutputType_currentIndexChanged(int index)
{
module.ppmOutputType = index;
emit modified();
}
void ModulePanel::on_channelsCount_editingFinished()
{
if (!lock) {