Skip to content

Commit

Permalink
Enable startup splash screen duration for color LCD radios.
Browse files Browse the repository at this point in the history
Add option to disable startup sound.
Add Companion support for changes.
  • Loading branch information
Phil Mitchell committed Apr 8, 2023
1 parent 2ce94e3 commit 827e35c
Show file tree
Hide file tree
Showing 49 changed files with 918 additions and 812 deletions.
10 changes: 4 additions & 6 deletions companion/src/firmwares/edgetx/yaml_generalsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,7 @@ Node convert<GeneralSettings>::encode(const GeneralSettings& rhs)
node["internalModuleBaudrate"] = internalModuleBaudrate.value;

node["internalModule"] = LookupValue(internalModuleLut, rhs.internalModule);
if (!IS_FAMILY_HORUS_OR_T16(fw->getBoard())) {
node["splashMode"] = rhs.splashMode;
}
node["splashMode"] = rhs.splashMode;
node["lightAutoOff"] = rhs.backlightDelay;
node["templateSetup"] = rhs.templateSetup;
node["hapticLength"] = rhs.hapticLength + 2;
Expand Down Expand Up @@ -218,6 +216,7 @@ Node convert<GeneralSettings>::encode(const GeneralSettings& rhs)
node["varioRange"] = rhs.varioRange * 15;
node["varioRepeat"] = rhs.varioRepeat;
node["backgroundVolume"] = rhs.backgroundVolume + 2;
node["dontPlayHello"] = (int)rhs.dontPlayHello;
if (Boards::getCapability(fw->getBoard(), Board::HasColorLcd)) {
node["modelQuickSelect"] = (int)rhs.modelQuickSelect;
}
Expand Down Expand Up @@ -384,9 +383,7 @@ bool convert<GeneralSettings>::decode(const Node& node, GeneralSettings& rhs)
rhs.internalModule = Boards::getDefaultInternalModules(fw->getBoard());
}

if (!IS_FAMILY_HORUS_OR_T16(fw->getBoard())) {
node["splashMode"] >> rhs.splashMode;
}
node["splashMode"] >> rhs.splashMode;
node["lightAutoOff"] >> rhs.backlightDelay;
node["templateSetup"] >> rhs.templateSetup;
node["hapticLength"] >> ioffset_int(rhs.hapticLength, 2);
Expand Down Expand Up @@ -419,6 +416,7 @@ bool convert<GeneralSettings>::decode(const Node& node, GeneralSettings& rhs)
node["varioRepeat"] >> rhs.varioRepeat;
node["backgroundVolume"] >> ioffset_int(rhs.backgroundVolume, 2);
node["modelQuickSelect"] >> rhs.modelQuickSelect;
node["dontPlayHello"] >> rhs.dontPlayHello;

// depreciated v2.7 replaced by serialPort
if (node["auxSerialMode"]) {
Expand Down
1 change: 1 addition & 0 deletions companion/src/firmwares/generalsettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ class GeneralSettings {
bool preBeep;
bool flashBeep;
int splashMode;
bool dontPlayHello;
unsigned int backlightDelay;
unsigned int templateSetup; //RETA order according to chout_ar array
int PPM_Multiplier;
Expand Down
15 changes: 10 additions & 5 deletions companion/src/generaledit/generalsetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,9 @@ ui(new Ui::GeneralSetup)

ui->rssiPowerOffWarnChkB->setChecked(!generalSettings.disableRssiPoweroffAlarm); // Default is zero=checked

ui->splashScreenDuration->setCurrentIndex(3-generalSettings.splashMode);
if (IS_FAMILY_HORUS_OR_T16(firmware->getBoard())) {
ui->splashScreenDuration->hide();
ui->splashScreenLabel->hide();
}
else {
ui->splashScreenDuration->setCurrentIndex(3-generalSettings.splashMode);
ui->splashScreenDuration->setItemText(0, QCoreApplication::translate("GeneralSetup", "1s", nullptr));
}

if (!firmware->getCapability(PwrButtonPress)) {
Expand Down Expand Up @@ -466,6 +463,8 @@ void GeneralSetupPanel::setValues()

ui->registrationId->setText(generalSettings.registrationId);

ui->startSoundCB->setChecked(!generalSettings.dontPlayHello);

if (Boards::getCapability(firmware->getBoard(), Board::HasColorLcd)) {
ui->modelQuickSelect_CB->setChecked(generalSettings.modelQuickSelect);
} else {
Expand Down Expand Up @@ -799,3 +798,9 @@ void GeneralSetupPanel::on_modelQuickSelect_CB_stateChanged(int)
generalSettings.modelQuickSelect = ui->modelQuickSelect_CB->isChecked();
emit modified();
}

void GeneralSetupPanel::on_startSoundCB_stateChanged(int)
{
generalSettings.dontPlayHello = !ui->startSoundCB->isChecked();
emit modified();
}
1 change: 1 addition & 0 deletions companion/src/generaledit/generalsetup.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class GeneralSetupPanel : public GeneralPanel
void on_pwrOffDelay_valueChanged(int);

void on_modelQuickSelect_CB_stateChanged(int);
void on_startSoundCB_stateChanged(int);

private:
Ui::GeneralSetup *ui;
Expand Down
Loading

0 comments on commit 827e35c

Please sign in to comment.