feat(color): Add OneBit option to color radios (and Companion!!) (#1994)
* Added OneBit option also to color radios * Try to work around GH repo owner issue Original by @raphaelcoeffic in https://github.com/EdgeTX/edgetx/commit/bf4b5d8c0c1e386d5a4852a80d459540bab98ed3 * Add Companion support for radios with external module * Companion housekeeping - do not display unnecessary hardware section headings * fix: Rebase cleanup * fix: LVGL changes * feat: Move sample mode to a new Ext RF block Co-authored-by: elecpower <neilh713@tpg.com.au> Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
co-authored by
elecpower
Peter Feerick
parent
54aaf5b9d9
commit
2ee75033bb
@@ -497,6 +497,9 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
|
||||
case HasInternalModuleSupport:
|
||||
return (IS_STM32(board) && !IS_TARANIS_X9(board));
|
||||
|
||||
case HasExternalModuleSupport:
|
||||
return (IS_STM32(board) && !IS_RADIOMASTER_T8(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)))
|
||||
|
||||
@@ -150,6 +150,7 @@ namespace Board {
|
||||
HasColorLcd,
|
||||
HasSDCard,
|
||||
HasInternalModuleSupport,
|
||||
HasExternalModuleSupport,
|
||||
SportMaxBaudRate
|
||||
};
|
||||
|
||||
|
||||
@@ -606,6 +606,38 @@ AbstractStaticItemModel * GeneralSettings::stickDeadZoneItemModel()
|
||||
return mdl;
|
||||
}
|
||||
|
||||
QString GeneralSettings::uartSampleModeToString() const
|
||||
{
|
||||
return uartSampleModeToString(uartSampleMode);
|
||||
}
|
||||
|
||||
// static
|
||||
QString GeneralSettings::uartSampleModeToString(int value)
|
||||
{
|
||||
switch(value) {
|
||||
case UART_SAMPLE_MODE_NORMAL:
|
||||
return tr("Normal");
|
||||
case UART_SAMPLE_MODE_ONEBIT:
|
||||
return tr("OneBit");
|
||||
default:
|
||||
return CPN_STR_UNKNOWN_ITEM;
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
AbstractStaticItemModel * GeneralSettings::uartSampleModeItemModel()
|
||||
{
|
||||
AbstractStaticItemModel * mdl = new AbstractStaticItemModel();
|
||||
mdl->setName(AIM_GS_UARTSAMPLEMODE);
|
||||
|
||||
for (int i = 0; i < UART_SAMPLE_MODE_COUNT; i++) {
|
||||
mdl->appendToItemList(uartSampleModeToString(i), i);
|
||||
}
|
||||
|
||||
mdl->loadItemList();
|
||||
return mdl;
|
||||
}
|
||||
|
||||
/*
|
||||
TrainerMix
|
||||
*/
|
||||
|
||||
@@ -41,6 +41,7 @@ constexpr char AIM_GS_BLUETOOTHMODE[] {"gs.bluetoothmode"};
|
||||
constexpr char AIM_GS_SERIALMODE[] {"gs.serialmode%1"};
|
||||
constexpr char AIM_GS_INTMODULEBAUDRATE[] {"gs.intmodulebaudrate"};
|
||||
constexpr char AIM_GS_STICKDEADZONE[] {"gs.stickdeadzone"};
|
||||
constexpr char AIM_GS_UARTSAMPLEMODE[] {"gs.uartsamplemode"};
|
||||
constexpr char AIM_TRAINERMIX_MODE[] {"trainermix.mode"};
|
||||
constexpr char AIM_TRAINERMIX_SRC[] {"trainermix.src"};
|
||||
|
||||
@@ -153,6 +154,12 @@ class GeneralSettings {
|
||||
SP_COUNT,
|
||||
};
|
||||
|
||||
enum UartSampleMode {
|
||||
UART_SAMPLE_MODE_NORMAL,
|
||||
UART_SAMPLE_MODE_ONEBIT,
|
||||
UART_SAMPLE_MODE_COUNT
|
||||
};
|
||||
|
||||
GeneralSettings() { clear(); }
|
||||
void clear();
|
||||
void init();
|
||||
@@ -274,6 +281,7 @@ class GeneralSettings {
|
||||
QString bluetoothModeToString() const;
|
||||
QString serialPortModeToString(int port_nr) const;
|
||||
QString internalModuleBaudrateToString() const;
|
||||
QString uartSampleModeToString() const;
|
||||
|
||||
static QString antennaModeToString(int value);
|
||||
static QString bluetoothModeToString(int value);
|
||||
@@ -281,9 +289,12 @@ class GeneralSettings {
|
||||
static QString moduleBaudrateToString(int value);
|
||||
static FieldRange getPPM_MultiplierRange();
|
||||
static FieldRange getTxCurrentCalibration();
|
||||
static QString uartSampleModeToString(int value);
|
||||
|
||||
static AbstractStaticItemModel * antennaModeItemModel();
|
||||
static AbstractStaticItemModel * bluetoothModeItemModel();
|
||||
static AbstractStaticItemModel * serialModeItemModel(int port_nr);
|
||||
static AbstractStaticItemModel * internalModuleBaudrateItemModel();
|
||||
static AbstractStaticItemModel * stickDeadZoneItemModel();
|
||||
static AbstractStaticItemModel * uartSampleModeItemModel();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user