Skip to content

Commit

Permalink
make checkbox only visible for radios with AUDIO_MUTE_GPIO pin:
Browse files Browse the repository at this point in the history
 - All color lcd radios (including NV14) except Horus X12S
 - TX12, TX12MK2, ZORRO, BOXER, T8, TLITE, TPRO, LR3PRO, COMMANDO8
  • Loading branch information
mha1 authored and pfeerick committed Jun 26, 2023
1 parent 0384d24 commit 2b5d245
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions companion/src/firmwares/boards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,11 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
case HasExternalModuleSupport:
return (IS_STM32(board) && !IS_RADIOMASTER_T8(board));

case HasAudioMuteGPIO:
// All color lcd (including NV14) except Horus X12S
// TX12, TX12MK2, ZORRO, BOXER, T8, TLITE, TPRO, LR3PRO, COMMANDO8
return (IS_FAMILY_HORUS_OR_T16(board) && !IS_HORUS_X12S(board)) || IS_FAMILY_T12(board);

case SportMaxBaudRate:
if (IS_FAMILY_T16(board) || IS_FLYSKY_NV14(board) || IS_TARANIS_X7_ACCESS(board) ||
(IS_TARANIS(board) && !IS_TARANIS_XLITE(board) && !IS_TARANIS_X7(board) && !IS_TARANIS_X9LITE(board)))
Expand Down
1 change: 1 addition & 0 deletions companion/src/firmwares/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ namespace Board {
HasSDCard,
HasInternalModuleSupport,
HasExternalModuleSupport,
HasAudioMuteGPIO,
SportMaxBaudRate
};

Expand Down
2 changes: 1 addition & 1 deletion companion/src/generaledit/hardware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings
addParams();
}

if (true) {
if (Boards::getCapability(board, Board::HasAudioMuteGPIO)) {
addLabel(tr("Mute if no sound"));
AutoCheckBox *muteIfNoSound = new AutoCheckBox(this);
muteIfNoSound->setField(generalSettings.muteIfNoSound, this, false);
Expand Down

0 comments on commit 2b5d245

Please sign in to comment.