diff --git a/companion/src/firmwares/edgetx/yaml_generalsettings.cpp b/companion/src/firmwares/edgetx/yaml_generalsettings.cpp index 738f3802f27..74490e7bebf 100644 --- a/companion/src/firmwares/edgetx/yaml_generalsettings.cpp +++ b/companion/src/firmwares/edgetx/yaml_generalsettings.cpp @@ -280,6 +280,7 @@ Node convert::encode(const GeneralSettings& rhs) node["antennaMode"] = antennaModeLut << rhs.antennaMode; node["pwrOnSpeed"] = rhs.pwrOnSpeed; node["pwrOffSpeed"] = rhs.pwrOffSpeed; + node["pwrOffIfInactive"] = rhs.pwrOffIfInactive; // Power off after inactivity node["disablePwrOnOffHaptic"] = (int)rhs.disablePwrOnOffHaptic; for (int i = 0; i < CPN_MAX_SPECIAL_FUNCTIONS; i++) { @@ -559,6 +560,7 @@ bool convert::decode(const Node& node, GeneralSettings& rhs) node["backlightColor"] >> rhs.backlightColor; node["pwrOnSpeed"] >> rhs.pwrOnSpeed; node["pwrOffSpeed"] >> rhs.pwrOffSpeed; + node["pwrOffIfInactive"] >> rhs.pwrOffIfInactive; // Power off after inactivity node["disablePwrOnOffHaptic"] >> rhs.disablePwrOnOffHaptic; if (node["customFn"]) { diff --git a/companion/src/firmwares/generalsettings.h b/companion/src/firmwares/generalsettings.h index 02de694a83a..fb0d19f27b2 100644 --- a/companion/src/firmwares/generalsettings.h +++ b/companion/src/firmwares/generalsettings.h @@ -314,6 +314,7 @@ class GeneralSettings { bool modelSFDisabled; bool modelCustomScriptsDisabled; bool modelTelemetryDisabled; + unsigned int pwrOffIfInactive; int modelSelectLayout; int labelSingleSelect; diff --git a/companion/src/generaledit/generalsetup.cpp b/companion/src/generaledit/generalsetup.cpp index 21fbdbb6014..34f87d21eda 100644 --- a/companion/src/generaledit/generalsetup.cpp +++ b/companion/src/generaledit/generalsetup.cpp @@ -284,6 +284,8 @@ ui(new Ui::GeneralSetup) ui->pwrOnDelay->hide(); ui->pwrOffDelayLabel->hide(); ui->pwrOffDelay->hide(); + ui->pwrOffIfInactiveLabel->hide(); + ui->pwrOffIfInactiveSB->hide(); } else if (!IS_TARANIS(board)) { ui->pwrOnDelayLabel->hide(); @@ -524,6 +526,7 @@ void GeneralSetupPanel::setValues() ui->pwrOnDelay->setCurrentIndex(pwrDelayFromYaml(generalSettings.pwrOnSpeed)); ui->pwrOffDelay->setCurrentIndex(pwrDelayFromYaml(generalSettings.pwrOffSpeed)); + ui->pwrOffIfInactiveSB->setValue(generalSettings.pwrOffIfInactive); ui->registrationId->setText(generalSettings.registrationId); @@ -831,6 +834,12 @@ void GeneralSetupPanel::on_inactimerSB_editingFinished() emit modified(); } +void GeneralSetupPanel::on_pwrOffIfInactiveSB_editingFinished() +{ + generalSettings.pwrOffIfInactive = ui->pwrOffIfInactiveSB->value(); + emit modified(); +} + void GeneralSetupPanel::on_memwarnChkB_stateChanged(int) { generalSettings.disableMemoryWarning = ui->memwarnChkB->isChecked() ? 0 : 1; diff --git a/companion/src/generaledit/generalsetup.h b/companion/src/generaledit/generalsetup.h index ee566b9002a..d114db7d772 100644 --- a/companion/src/generaledit/generalsetup.h +++ b/companion/src/generaledit/generalsetup.h @@ -104,6 +104,8 @@ class GeneralSetupPanel : public GeneralPanel void on_favMultiMode_CB_currentIndexChanged(int); void on_invertLCD_CB_stateChanged(int); + void on_pwrOffIfInactiveSB_editingFinished(); + private: Ui::GeneralSetup *ui; diff --git a/companion/src/generaledit/generalsetup.ui b/companion/src/generaledit/generalsetup.ui index fa532b05319..d4a6368f631 100644 --- a/companion/src/generaledit/generalsetup.ui +++ b/companion/src/generaledit/generalsetup.ui @@ -1274,8 +1274,8 @@ p, li { white-space: pre-wrap; } QLayout::SizeConstraint::SetDefaultConstraint - - + + 0 @@ -1285,33 +1285,16 @@ p, li { white-space: pre-wrap; } 0 - 22 + 0 - - - Quiet - - - - - Only Alarms - - - - - No Keys - - - - - All - - + + Haptic Mode + - - + + 0 @@ -1324,32 +1307,101 @@ p, li { white-space: pre-wrap; } 0 + + + - Haptic Strength + Contrast - - + + + + + 0 + 0 + + + + + 0 + 22 + + + + + + + + + + If not zero will sound beeps if the transmitter has been left without inputs for the specified number of minutes. + + + min + + + 120 + + + + + + + + + + + + + Mode selection: + +Mode 1: + Left stick: Elevator, Rudder + Right stick: Throttle, Aileron + +Mode 2: + Left stick: Throttle, Rudder + Right stick: Elevator, Aileron + +Mode 3: + Left stick: Elevator, Aileron + Right stick: Throttle, Rudder + +Mode 4: + Left stick: Throttle, Aileron + Right stick: Elevator, Rudder + + + + + 1 + - Ask on Connect + Mode 1 (RUD ELE THR AIL) - Audio + Mode 2 (RUD THR ELE AIL) - Trainer + Mode 3 (AIL ELE THR RUD) + + + + + Mode 4 (AIL THR ELE RUD) - - + + 0 @@ -1363,41 +1415,36 @@ p, li { white-space: pre-wrap; } - Inactivity Timer + Battery Meter Range - - - - - 0s - - + + - 0.5s + Ask on Connect - 1s + Joystick (HID) - 2s + USB Mass Storage - 3s + USB Serial (CDC) - - + + 0 @@ -1411,12 +1458,12 @@ p, li { white-space: pre-wrap; } - Haptic Mode + Low EEPROM Warning - - + + 0 @@ -1430,12 +1477,12 @@ p, li { white-space: pre-wrap; } - Beeper Length + RSSI Poweroff Warning - - + + 0 @@ -1450,40 +1497,28 @@ p, li { white-space: pre-wrap; } - X-Short - - - - - Short + Quiet - Normal + Only Alarms - Long + No Keys - X-Long + All - - - - Power On Delay - - - - - + + 0 @@ -1492,35 +1527,19 @@ p, li { white-space: pre-wrap; } - 20 + 0 0 - - - - - Battery Warning - - - - - - - - 0 - 0 - - - Play Delay (switch mid position) + Haptic Strength - - + + - + 0 0 @@ -1531,130 +1550,77 @@ p, li { white-space: pre-wrap; } 22 - - - - - + + + 16777215 + 16777215 + - Battery warning voltage. -This is the threshold where the battery warning sounds. - -Acceptable values are 3v..12v - - - - - - V - - - 1 - - - 3.000000000000000 - - - 12.000000000000000 + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" text-decoration: underline;">Warnings</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These will define startup warnings.</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Throttle warning - will alert if the throttle is not at idle during startup</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Switch warning - will alert if switches are not in their defaul position</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Memory warning - will alert if there's not a lot of memory left</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Silent mode warning - will alert you if the beeper is set to quiet (0)</p></body></html> - - 0.100000000000000 + + - - 9.600000000000000 + + true - - + + - 0s + 4800 Baud - 0.5s - - - - - 1s - - - - - 2s + 9600 Baud - 3s + 14400 Baud - - - - - - - 0 - 0 - - - - - 0 - 22 - - - X-Short + 19200 Baud - Short + 38400 Baud - Normal + 57600 Baud - Long + 76800 Baud - X-Long + 115200 Baud - - - - - 0 - 0 - - - - - 0 - 0 - - - - Beeper Mode - - - @@ -1683,43 +1649,52 @@ Acceptable values are 3v..12v - - - - + + + + + 0 + 0 + - - + + + 16777215 + 16777215 + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">LCD Screen Contrast</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Values can be 20-45</span></p></body></html> - - - ms - - - 0 +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" text-decoration: underline;">Warnings</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These will define startup warnings.</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Throttle warning - will alert if the throttle is not at idle during startup</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Switch warning - will alert if switches are not in their defaul position</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Memory warning - will alert if there's not a lot of memory left</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Silent mode warning - will alert you if the beeper is set to quiet (0)</p></body></html> - - 1000 + + - - 10 + + true - - 0 + + + + + + PPM Units - - + + - + 0 0 @@ -1727,176 +1702,120 @@ p, li { white-space: pre-wrap; } 0 - 0 + 22 + + + + + 16777215 + 16777215 + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" text-decoration: underline;">Warnings</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These will define startup warnings.</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Throttle warning - will alert if the throttle is not at idle during startup</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Switch warning - will alert if switches are not in their defaul position</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Memory warning - will alert if there's not a lot of memory left</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Silent mode warning - will alert you if the beeper is set to quiet (0)</p></body></html> + - Haptic Length + + + + true - - - - + + + + USB Mode - + + + + + - - <html><head/><body><p>Channel order</p><p><br/></p><p>Defines the order of the default mixes created on a new model.</p></body></html> - - - 0 - - - - R E T A - - - - - R E A T - - - - - R T E A - - - - - R T A E - - - - - R A E T - - - - - R A T E - - - - - E R T A - - - - - E R A T - - - - - E T R A - - - - - E T A R - - - - - E A R T - - - - - E A T R - - + + + + - T R E A + DMS - T R A E + NMEA + + + + + + + 0 + 0 + + + + + 0 + 22 + + - T E R A + X-Short - T E A R + Short - T A R E + Normal - T A E R + Long - A R E T - - - - - A R T E - - - - - A E R T - - - - - A E T R - - - - - A T R E - - - - - A T E R + X-Long - - - - - Ask on Connect - - - - - Joystick (HID) - - - - - USB Mass Storage - - - - - USB Serial (CDC) - - - + + + + Qt::Orientation::Vertical + + + + 20 + 40 + + + - - + + 0 @@ -1906,25 +1825,40 @@ p, li { white-space: pre-wrap; } 0 - 0 + 22 - - Low EEPROM Warning + + + + + + + + + + + 10 + + + 45 + + + 25 - - + + - USB Mode + Power On Delay - - + + - + 0 0 @@ -1932,34 +1866,34 @@ p, li { white-space: pre-wrap; } 0 - 22 - - - - - 16777215 - 16777215 + 0 - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" text-decoration: underline;">Warnings</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These will define startup warnings.</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Throttle warning - will alert if the throttle is not at idle during startup</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Switch warning - will alert if switches are not in their defaul position</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Memory warning - will alert if there's not a lot of memory left</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Silent mode warning - will alert you if the beeper is set to quiet (0)</p></body></html> - - + Beeper Length - - true + + + + + + 0.-- + + + 0.-- + + + + + 0.0 + + + + + us + + @@ -1969,151 +1903,226 @@ p, li { white-space: pre-wrap; } - - + + + + + + + + + + <html><head/><body><p>Channel order</p><p><br/></p><p>Defines the order of the default mixes created on a new model.</p></body></html> + + + 0 + - 4800 Baud + R E T A - 9600 Baud + R E A T - 14400 Baud + R T E A - 19200 Baud + R T A E - 38400 Baud + R A E T - 57600 Baud + R A T E - 76800 Baud + E R T A - 115200 Baud + E R A T + + + + + E T R A + + + + + E T A R + + + + + E A R T + + + + + E A T R + + + + + T R E A + + + + + T R A E + + + + + T E R A + + + + + T E A R + + + + + T A R E + + + + + T A E R + + + + + A R E T + + + + + A R T E + + + + + A E R T + + + + + A E T R + + + + + A T R E + + + + + A T E R - - - - - 0 - 0 - - - - - 0 - 22 - - - - - - - - - - Beeper volume - -0 - Quiet. No beeps at all. -1 - No Keys. Normal beeps but menu keys do not beep. -2 - Normal. -3 - Loud. -4 - Extra loud. - + + - Quiet + 0s - Alarms Only + 0.5s - No Keys + 1s - All + 2s + + + + + 3s - - - - Power Off Delay - + + + + + Ask on Connect + + + + + Audio + + + + + Trainer + + - - - - - 0 - 0 - - + + - MAVLink Baud Rate + Stick Mode - - - - Measurement Units + + + + + 0 + 0 + - - - - - + Play Delay (switch mid position) - + Trainer Poweroff Warning - - + + - Play Startup Sound + GPS Coordinates - - + + 0 @@ -2126,16 +2135,13 @@ p, li { white-space: pre-wrap; } 0 - - - - Contrast + Show Splash Screen on Startup - - + + 0 @@ -2145,118 +2151,88 @@ p, li { white-space: pre-wrap; } 0 - 0 + 22 - - RSSI Poweroff Warning - - - - - - - - 0 - 0 - - - - - 0 - 0 - + + - - LCD Display Type + + - - - - - - GPS Coordinates + + Beeper volume + +0 - Quiet. No beeps at all. +1 - No Keys. Normal beeps but menu keys do not beep. +2 - Normal. +3 - Loud. +4 - Extra loud. - - - - - - - Min - - + + Quiet + - - - v - - - 1 - - - 3.000000000000000 - - - 16.000000000000000 - - - 0.100000000000000 - - - 9.000000000000000 - - + + Alarms Only + - - - Max - - + + No Keys + - - - v - - - 1 - - - 3.000000000000000 - - - 16.000000000000000 - - - 0.100000000000000 - - - 12.000000000000000 - - + + All + - + - + - PPM Units + Hats Mode - - - - Stick Mode + + + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">LCD Screen Contrast</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Values can be 20-45</span></p></body></html> + + + ms + + + 0 + + + 1000 + + + 10 + + + 0 - - + + 0 @@ -2270,123 +2246,109 @@ p, li { white-space: pre-wrap; } - Show Splash Screen on Startup + LCD Display Type - - - - - Metric - - - - - Imperial - - + + + + Power ON/OFF Haptic + - - - - - - - - - - Mode selection: - -Mode 1: - Left stick: Elevator, Rudder - Right stick: Throttle, Aileron - -Mode 2: - Left stick: Throttle, Rudder - Right stick: Elevator, Aileron - -Mode 3: - Left stick: Elevator, Aileron - Right stick: Throttle, Rudder - -Mode 4: - Left stick: Throttle, Aileron - Right stick: Elevator, Rudder - - + + + + + 0 + 0 + - - 1 + + + 0 + 22 + - Mode 1 (RUD ELE THR AIL) + X-Short - Mode 2 (RUD THR ELE AIL) + Short - Mode 3 (AIL ELE THR RUD) + Normal - Mode 4 (AIL THR ELE RUD) + Long + + + + + X-Long - - + + - Hats Mode + Power Off Delay - - + + + + + 0 + 0 + + + + Default Channel Order + + + + + - DMS + 0s - NMEA + 0.5s - - - - - - 0.-- - - 0.-- + 1s - 0.0 + 2s - us + 3s - - + + 0 @@ -2396,48 +2358,79 @@ Mode 4: 0 - 22 + 0 - - - - - - - - If not zero will sound beeps if the transmitter has been left without inputs for the specified number of minutes. + + Inactivity Timer - - min + + + + + + + Metric + + + + + Imperial + + + + + + + + Measurement Units - - 120 + + + + + + Play Startup Sound - - - - Qt::Orientation::Vertical + + + + + 0 + 0 + - + - 20 - 40 + 16777215 + 16777215 - - - - + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" text-decoration: underline;">Warnings</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These will define startup warnings.</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Throttle warning - will alert if the throttle is not at idle during startup</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Switch warning - will alert if switches are not in their defaul position</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Memory warning - will alert if there's not a lot of memory left</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Silent mode warning - will alert you if the beeper is set to quiet (0)</p></body></html> + - Jack Mode + + + + true - - + + 0 @@ -2453,25 +2446,40 @@ Mode 4: - - + + + + + Battery warning voltage. +This is the threshold where the battery warning sounds. + +Acceptable values are 3v..12v + + + + + + V - - + + 1 - 10 + 3.000000000000000 - 45 + 12.000000000000000 + + + 0.100000000000000 - 25 + 9.600000000000000 - - + + 0 @@ -2481,23 +2489,16 @@ Mode 4: 0 - 22 + 0 - - - Standard - - - - - Optrex - - + + Beeper Mode + - - + + 0 @@ -2511,7 +2512,7 @@ Mode 4: - Battery Meter Range + "No Sound" Warning @@ -2569,24 +2570,8 @@ Mode 4: - - - - - - - - 0 - 0 - - - - Default Channel Order - - - - - + + 0 @@ -2595,130 +2580,165 @@ Mode 4: - 0 + 20 0 + + + - "No Sound" Warning + Battery Warning - - + + - + 0 0 - + - 16777215 - 16777215 + 0 + 22 - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" text-decoration: underline;">Warnings</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These will define startup warnings.</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Throttle warning - will alert if the throttle is not at idle during startup</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Switch warning - will alert if switches are not in their defaul position</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Memory warning - will alert if there's not a lot of memory left</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Silent mode warning - will alert you if the beeper is set to quiet (0)</p></body></html> - - - - - - true - + + + Standard + + + + + Optrex + + - - + + - + 0 0 - + - 16777215 - 16777215 + 0 + 0 - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" text-decoration: underline;">Warnings</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These will define startup warnings.</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Throttle warning - will alert if the throttle is not at idle during startup</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Switch warning - will alert if switches are not in their defaul position</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Memory warning - will alert if there's not a lot of memory left</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Silent mode warning - will alert you if the beeper is set to quiet (0)</p></body></html> - - - - - true + Haptic Length - - + + - Power ON/OFF Haptic + Jack Mode - - - - - 0 - 0 - - + + + + + + Min + + + + + + + v + + + 1 + + + 3.000000000000000 + + + 16.000000000000000 + + + 0.100000000000000 + + + 9.000000000000000 + + + + + + + Max + + + + + + + v + + + 1 + + + 3.000000000000000 + + + 16.000000000000000 + + + 0.100000000000000 + + + 12.000000000000000 + + + + + + + + + + 0 - 22 + 0 - - - 16777215 - 16777215 - + + MAVLink Baud Rate + + + + + + + Power Auto Off + + + + - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" text-decoration: underline;">Warnings</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These will define startup warnings.</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Throttle warning - will alert if the throttle is not at idle during startup</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Switch warning - will alert if switches are not in their defaul position</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Memory warning - will alert if there's not a lot of memory left</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Silent mode warning - will alert you if the beeper is set to quiet (0)</p></body></html> + If not zero transmitter will shut down if it has been left without inputs for the specified number of minutes. - - + + min - - true + + 255 diff --git a/radio/src/datastructs.h b/radio/src/datastructs.h index 6215d367e68..4a3e1852a1e 100644 --- a/radio/src/datastructs.h +++ b/radio/src/datastructs.h @@ -83,11 +83,11 @@ static inline void check_struct() #endif #if defined(PCBXLITES) - CHKSIZE(RadioData, 871); + CHKSIZE(RadioData, 872); #elif defined(COLORLCD) - CHKSIZE(RadioData, 965); + CHKSIZE(RadioData, 966); #else - CHKSIZE(RadioData, 869); + CHKSIZE(RadioData, 870); #endif #if defined(RADIO_TPRO) || defined(RADIO_TPROV2) diff --git a/radio/src/datastructs_private.h b/radio/src/datastructs_private.h index 6a7ea6c4915..4a42f6fe33b 100644 --- a/radio/src/datastructs_private.h +++ b/radio/src/datastructs_private.h @@ -987,9 +987,7 @@ PACK(struct RadioData { NOBACKUP(uint8_t modelSFDisabled:1); NOBACKUP(uint8_t modelCustomScriptsDisabled:1); NOBACKUP(uint8_t modelTelemetryDisabled:1); - NOBACKUP(uint8_t disableTrainerPoweroffAlarm:1); - NOBACKUP(uint8_t disablePwrOnOffHaptic:1); #if defined(COLORLCD) @@ -1001,6 +999,8 @@ PACK(struct RadioData { NOBACKUP(uint8_t spare:4 SKIP); #endif + NOBACKUP(uint8_t pwrOffIfInactive); + NOBACKUP(uint8_t getBrightness() const { #if defined(OLED_SCREEN) diff --git a/radio/src/edgetx.cpp b/radio/src/edgetx.cpp index 671bbe36d01..ebd6d4cbdfd 100644 --- a/radio/src/edgetx.cpp +++ b/radio/src/edgetx.cpp @@ -40,6 +40,7 @@ #include "switches.h" #include "inactivity_timer.h" #include "input_mapping.h" +#include "trainer.h" #include "tasks.h" #include "tasks/mixer_task.h" @@ -1648,6 +1649,25 @@ uint32_t pwrPressedDuration() inline tmr10ms_t getTicks() { return g_tmr10ms; } #endif +bool pwrOffDueToInactivity() +{ + uint8_t inactivityLimit = g_eeGeneral.pwrOffIfInactive; + static tmr10ms_t lastConnectedTime = 0; + + tmr10ms_t currentTime = get_tmr10ms(); + + if (TELEMETRY_STREAMING() || + (usbPlugged() && getSelectedUsbMode() != USB_UNSELECTED_MODE) || + isTrainerValid()) + lastConnectedTime = currentTime; + + bool inactivityShutdown = + inactivityLimit && inactivity.counter > 60u * inactivityLimit && + (currentTime - lastConnectedTime) / 100u > 60u * inactivityLimit; + + return inactivityShutdown; +} + uint32_t pwrCheck() { const char * message = nullptr; @@ -1660,11 +1680,14 @@ uint32_t pwrCheck() static uint8_t pwr_check_state = PWR_CHECK_ON; + bool inactivityShutdown = pwrOffDueToInactivity(); + if (pwr_check_state == PWR_CHECK_OFF) { return e_power_off; } - else if (pwrPressed()) { - inactivityTimerReset(ActivitySource::Keys); + else if (pwrPressed() || inactivityShutdown) { + if (!inactivityShutdown) + inactivityTimerReset(ActivitySource::Keys); if (TELEMETRY_STREAMING()) { message = STR_MODEL_STILL_POWERED; diff --git a/radio/src/gui/128x64/radio_setup.cpp b/radio/src/gui/128x64/radio_setup.cpp index dc244f600ca..c10ec4afad9 100644 --- a/radio/src/gui/128x64/radio_setup.cpp +++ b/radio/src/gui/128x64/radio_setup.cpp @@ -93,6 +93,7 @@ enum { ITEM_RADIO_SETUP_START_SOUND, CASE_PWR_BUTTON_PRESS(ITEM_RADIO_SETUP_PWR_ON_SPEED) CASE_PWR_BUTTON_PRESS(ITEM_RADIO_SETUP_PWR_OFF_SPEED) + CASE_PWR_BUTTON_PRESS(ITEM_RADIO_SETUP_PWR_AUTO_OFF) CASE_HAPTIC(ITEM_RADIO_SETUP_PWR_ON_OFF_HAPTIC) CASE_PXX2(ITEM_RADIO_SETUP_OWNER_ID) CASE_GPS(ITEM_RADIO_SETUP_LABEL_GPS) @@ -191,6 +192,7 @@ void menuRadioSetup(event_t event) 0, CASE_PWR_BUTTON_PRESS(0) CASE_PWR_BUTTON_PRESS(0) + CASE_PWR_BUTTON_PRESS(0) CASE_HAPTIC(0) // power on/off haptic CASE_PXX2(0) /* owner registration ID */ @@ -590,6 +592,13 @@ void menuRadioSetup(event_t event) case ITEM_RADIO_SETUP_PWR_OFF_SPEED: g_eeGeneral.pwrOffSpeed = pwrDelayToYaml(editChoice(LCD_W-2, y, STR_PWR_OFF_DELAY, STR_PWR_OFF_DELAYS, pwrDelayFromYaml(g_eeGeneral.pwrOffSpeed), 0, 4, attr|RIGHT, event)); break; + + case ITEM_RADIO_SETUP_PWR_AUTO_OFF: + lcdDrawTextAlignedLeft(y, STR_PWR_AUTO_OFF); + lcdDrawNumber(LCD_W-7, y, g_eeGeneral.pwrOffIfInactive, attr|RIGHT); + lcdDrawChar(lcdLastRightPos, y, 'm'); + if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.pwrOffIfInactive, 0, 255); + break; #endif #if defined(HAPTIC) diff --git a/radio/src/gui/212x64/radio_setup.cpp b/radio/src/gui/212x64/radio_setup.cpp index 35b73c71666..a2e5fbb054c 100644 --- a/radio/src/gui/212x64/radio_setup.cpp +++ b/radio/src/gui/212x64/radio_setup.cpp @@ -82,6 +82,7 @@ enum MenuRadioSetupItems { ITEM_RADIO_SETUP_START_SOUND, CASE_PWR_BUTTON_PRESS(ITEM_RADIO_SETUP_PWR_ON_SPEED) CASE_PWR_BUTTON_PRESS(ITEM_RADIO_SETUP_PWR_OFF_SPEED) + CASE_PWR_BUTTON_PRESS(ITEM_RADIO_SETUP_PWR_AUTO_OFF) CASE_HAPTIC(ITEM_RADIO_SETUP_PWR_ON_OFF_HAPTIC) #if defined(PXX2) ITEM_RADIO_SETUP_OWNER_ID, @@ -195,6 +196,7 @@ void menuRadioSetup(event_t event) 0, CASE_PWR_BUTTON_PRESS(0) // pwr on speed CASE_PWR_BUTTON_PRESS(0) // pwr off speed + CASE_PWR_BUTTON_PRESS(0) // pwr auto off CASE_HAPTIC(0) // power on/off haptic CASE_PXX2(0) // owner registration ID CASE_GPS(LABEL(GPS)) @@ -549,11 +551,18 @@ void menuRadioSetup(event_t event) #if defined(PWR_BUTTON_PRESS) case ITEM_RADIO_SETUP_PWR_ON_SPEED: - g_eeGeneral.pwrOnSpeed = pwrDelayToYaml(editChoice(LCD_W-2, y, STR_PWR_ON_DELAY, STR_PWR_OFF_DELAYS, pwrDelayFromYaml(g_eeGeneral.pwrOnSpeed), 0, 4, attr|RIGHT, event)); + g_eeGeneral.pwrOnSpeed = pwrDelayToYaml(editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_PWR_ON_DELAY, STR_PWR_OFF_DELAYS, pwrDelayFromYaml(g_eeGeneral.pwrOnSpeed), 0, 4, attr|LEFT, event)); break; case ITEM_RADIO_SETUP_PWR_OFF_SPEED: - g_eeGeneral.pwrOffSpeed = pwrDelayToYaml(editChoice(LCD_W-2, y, STR_PWR_OFF_DELAY, STR_PWR_OFF_DELAYS, pwrDelayFromYaml(g_eeGeneral.pwrOffSpeed), 0, 4, attr|RIGHT, event)); + g_eeGeneral.pwrOffSpeed = pwrDelayToYaml(editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_PWR_OFF_DELAY, STR_PWR_OFF_DELAYS, pwrDelayFromYaml(g_eeGeneral.pwrOffSpeed), 0, 4, attr|LEFT, event)); + break; + + case ITEM_RADIO_SETUP_PWR_AUTO_OFF: + lcdDrawTextAlignedLeft(y, STR_PWR_AUTO_OFF); + lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.pwrOffIfInactive, attr|LEFT); + lcdDrawChar(lcdLastRightPos, y, 'm'); + if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.pwrOffIfInactive, 0, 255); break; #endif diff --git a/radio/src/gui/colorlcd/radio/radio_setup.cpp b/radio/src/gui/colorlcd/radio/radio_setup.cpp index 660119ba0c2..ac0f1b8a6e3 100644 --- a/radio/src/gui/colorlcd/radio/radio_setup.cpp +++ b/radio/src/gui/colorlcd/radio/radio_setup.cpp @@ -770,6 +770,16 @@ static SetupLineDef setupLines[] = { }); } }, + + // Pwr Off If Inactive + { + STR_PWR_AUTO_OFF, + [](Window* parent, coord_t x, coord_t y) { + auto edit = new NumberEdit(parent,{x, y, RadioSetupPage::NUM_W, EdgeTxStyles::UI_ELEMENT_HEIGHT}, 0, + 255, GET_SET_DEFAULT(g_eeGeneral.pwrOffIfInactive)); + edit->setSuffix(" min"); + } + }, #endif #if defined(HAPTIC) { diff --git a/radio/src/storage/yaml/yaml_datastructs_128x64.cpp b/radio/src/storage/yaml/yaml_datastructs_128x64.cpp index 007a4b2c2ec..8f39f3d1e39 100644 --- a/radio/src/storage/yaml/yaml_datastructs_128x64.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_128x64.cpp @@ -362,6 +362,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_UNSIGNED( "disablePwrOnOffHaptic", 1 ), YAML_UNSIGNED( "invertLCD", 1 ), YAML_PADDING( 3 ), + YAML_UNSIGNED( "pwrOffIfInactive", 8 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = { diff --git a/radio/src/storage/yaml/yaml_datastructs_nv14.cpp b/radio/src/storage/yaml/yaml_datastructs_nv14.cpp index e8a98b6f012..f18f8d4d147 100644 --- a/radio/src/storage/yaml/yaml_datastructs_nv14.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_nv14.cpp @@ -386,6 +386,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_UNSIGNED( "disableTrainerPoweroffAlarm", 1 ), YAML_UNSIGNED( "disablePwrOnOffHaptic", 1 ), YAML_PADDING( 6 ), + YAML_UNSIGNED( "pwrOffIfInactive", 8 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = { diff --git a/radio/src/storage/yaml/yaml_datastructs_pl18.cpp b/radio/src/storage/yaml/yaml_datastructs_pl18.cpp index 90508b4ea08..38f29cdc3a5 100644 --- a/radio/src/storage/yaml/yaml_datastructs_pl18.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_pl18.cpp @@ -386,6 +386,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_UNSIGNED( "disableTrainerPoweroffAlarm", 1 ), YAML_UNSIGNED( "disablePwrOnOffHaptic", 1 ), YAML_PADDING( 6 ), + YAML_UNSIGNED( "pwrOffIfInactive", 8 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = { diff --git a/radio/src/storage/yaml/yaml_datastructs_t15.cpp b/radio/src/storage/yaml/yaml_datastructs_t15.cpp index 01f6d577a4a..d9744c7f40f 100644 --- a/radio/src/storage/yaml/yaml_datastructs_t15.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_t15.cpp @@ -388,6 +388,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_UNSIGNED( "disableTrainerPoweroffAlarm", 1 ), YAML_UNSIGNED( "disablePwrOnOffHaptic", 1 ), YAML_PADDING( 6 ), + YAML_UNSIGNED( "pwrOffIfInactive", 8 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = { diff --git a/radio/src/storage/yaml/yaml_datastructs_t20.cpp b/radio/src/storage/yaml/yaml_datastructs_t20.cpp index c39a02703b7..6e767a25397 100644 --- a/radio/src/storage/yaml/yaml_datastructs_t20.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_t20.cpp @@ -362,6 +362,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_UNSIGNED( "disablePwrOnOffHaptic", 1 ), YAML_UNSIGNED( "invertLCD", 1 ), YAML_PADDING( 3 ), + YAML_UNSIGNED( "pwrOffIfInactive", 8 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = { diff --git a/radio/src/storage/yaml/yaml_datastructs_tpro.cpp b/radio/src/storage/yaml/yaml_datastructs_tpro.cpp index da473f47238..0222ff5c5a3 100644 --- a/radio/src/storage/yaml/yaml_datastructs_tpro.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_tpro.cpp @@ -362,6 +362,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_UNSIGNED( "disablePwrOnOffHaptic", 1 ), YAML_UNSIGNED( "invertLCD", 1 ), YAML_PADDING( 3 ), + YAML_UNSIGNED( "pwrOffIfInactive", 8 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = { diff --git a/radio/src/storage/yaml/yaml_datastructs_x10.cpp b/radio/src/storage/yaml/yaml_datastructs_x10.cpp index 78b36eed5a1..d1d37c3547f 100644 --- a/radio/src/storage/yaml/yaml_datastructs_x10.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_x10.cpp @@ -388,6 +388,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_UNSIGNED( "disableTrainerPoweroffAlarm", 1 ), YAML_UNSIGNED( "disablePwrOnOffHaptic", 1 ), YAML_PADDING( 6 ), + YAML_UNSIGNED( "pwrOffIfInactive", 8 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = { diff --git a/radio/src/storage/yaml/yaml_datastructs_x9d.cpp b/radio/src/storage/yaml/yaml_datastructs_x9d.cpp index 5b1c439b7db..5d78a8d872d 100644 --- a/radio/src/storage/yaml/yaml_datastructs_x9d.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_x9d.cpp @@ -360,6 +360,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_UNSIGNED( "disableTrainerPoweroffAlarm", 1 ), YAML_UNSIGNED( "disablePwrOnOffHaptic", 1 ), YAML_PADDING( 4 ), + YAML_UNSIGNED( "pwrOffIfInactive", 8 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = { diff --git a/radio/src/storage/yaml/yaml_datastructs_x9dp2019.cpp b/radio/src/storage/yaml/yaml_datastructs_x9dp2019.cpp index aea47ac5210..9809730d42b 100644 --- a/radio/src/storage/yaml/yaml_datastructs_x9dp2019.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_x9dp2019.cpp @@ -361,6 +361,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_UNSIGNED( "disableTrainerPoweroffAlarm", 1 ), YAML_UNSIGNED( "disablePwrOnOffHaptic", 1 ), YAML_PADDING( 4 ), + YAML_UNSIGNED( "pwrOffIfInactive", 8 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = { diff --git a/radio/src/storage/yaml/yaml_datastructs_x9e.cpp b/radio/src/storage/yaml/yaml_datastructs_x9e.cpp index c1a49413cfc..b95c78c8a7e 100644 --- a/radio/src/storage/yaml/yaml_datastructs_x9e.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_x9e.cpp @@ -361,6 +361,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_UNSIGNED( "disableTrainerPoweroffAlarm", 1 ), YAML_UNSIGNED( "disablePwrOnOffHaptic", 1 ), YAML_PADDING( 4 ), + YAML_UNSIGNED( "pwrOffIfInactive", 8 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = { diff --git a/radio/src/storage/yaml/yaml_datastructs_xlite.cpp b/radio/src/storage/yaml/yaml_datastructs_xlite.cpp index 7f5efd7706c..8e2ac806aa8 100644 --- a/radio/src/storage/yaml/yaml_datastructs_xlite.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_xlite.cpp @@ -361,6 +361,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_UNSIGNED( "disablePwrOnOffHaptic", 1 ), YAML_UNSIGNED( "invertLCD", 1 ), YAML_PADDING( 3 ), + YAML_UNSIGNED( "pwrOffIfInactive", 8 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = { diff --git a/radio/src/storage/yaml/yaml_datastructs_xlites.cpp b/radio/src/storage/yaml/yaml_datastructs_xlites.cpp index 239e008d68e..e8d517235d4 100644 --- a/radio/src/storage/yaml/yaml_datastructs_xlites.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_xlites.cpp @@ -365,6 +365,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_UNSIGNED( "disablePwrOnOffHaptic", 1 ), YAML_UNSIGNED( "invertLCD", 1 ), YAML_PADDING( 3 ), + YAML_UNSIGNED( "pwrOffIfInactive", 8 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = { diff --git a/radio/src/translations.cpp b/radio/src/translations.cpp index 6c39ba3565d..dd1eaa74c19 100644 --- a/radio/src/translations.cpp +++ b/radio/src/translations.cpp @@ -342,6 +342,7 @@ const char STR_SPLASHSCREEN[] = TR_SPLASHSCREEN; const char STR_PLAY_HELLO[] = TR_PLAY_HELLO; const char STR_PWR_ON_DELAY[] = TR_PWR_ON_DELAY; const char STR_PWR_OFF_DELAY[] = TR_PWR_OFF_DELAY; +const char STR_PWR_AUTO_OFF[] = TR_PWR_AUTO_OFF; const char STR_THROTTLE_UPPERCASE[] = TR_THROTTLE_UPPERCASE; const char STR_SWITCHWARNING[] = TR_SWITCHWARNING; const char STR_POTWARNINGSTATE[] = TR_POTWARNINGSTATE; diff --git a/radio/src/translations.h b/radio/src/translations.h index 0f51e51a9d5..25521dd6b65 100644 --- a/radio/src/translations.h +++ b/radio/src/translations.h @@ -417,6 +417,7 @@ extern const char* const STR_SPLASHSCREEN_DELAYS[]; #if defined(PWR_BUTTON_PRESS) extern const char STR_PWR_ON_DELAY[]; extern const char STR_PWR_OFF_DELAY[]; +extern const char STR_PWR_AUTO_OFF[]; extern const char* const STR_PWR_OFF_DELAYS[]; #endif #if defined(HAPTIC) diff --git a/radio/src/translations/cn.h b/radio/src/translations/cn.h index 2109320b516..1909d3e9c6e 100644 --- a/radio/src/translations/cn.h +++ b/radio/src/translations/cn.h @@ -391,6 +391,7 @@ #define TR_PLAY_HELLO "开机语音" #define TR_PWR_ON_DELAY "开机延迟" #define TR_PWR_OFF_DELAY "关机延迟" +#define TR_PWR_AUTO_OFF TR("Pwr Auto Off","Power Auto Off") #define TR_PWR_ON_OFF_HAPTIC TR("开关机震动","开关机震动提示") #define TR_THROTTLE_WARNING TR("油门状态", "油门状态") #define TR_CUSTOM_THROTTLE_WARNING TR("自定位置", "自定油门位置?") diff --git a/radio/src/translations/cz.h b/radio/src/translations/cz.h index 98bc8f13b26..bae6c1801c6 100644 --- a/radio/src/translations/cz.h +++ b/radio/src/translations/cz.h @@ -407,6 +407,7 @@ #define TR_PLAY_HELLO "Zvuk při spuštění" #define TR_PWR_ON_DELAY "Zpoždění zapnutí" #define TR_PWR_OFF_DELAY "Zpoždění vypnutí" +#define TR_PWR_AUTO_OFF TR("Pwr Auto Off","Power Auto Off") #define TR_PWR_ON_OFF_HAPTIC TR("Zap ON/OFF vibrace","Zapnutí ON/OFF vibrace") #define TR_THROTTLE_WARNING TR("* Plyn", "Kontrola plynu") #define TR_CUSTOM_THROTTLE_WARNING TR("Vlas-Poz", "Vlastní pozice?") diff --git a/radio/src/translations/da.h b/radio/src/translations/da.h index d3674998dca..ac01bb6d582 100644 --- a/radio/src/translations/da.h +++ b/radio/src/translations/da.h @@ -400,6 +400,7 @@ #define TR_PLAY_HELLO "Startop lyd" #define TR_PWR_ON_DELAY "Forsinkelse ved tænd" #define TR_PWR_OFF_DELAY "Forsinkelse ved sluk" +#define TR_PWR_AUTO_OFF TR("Pwr Auto Off","Power Auto Off") #define TR_PWR_ON_OFF_HAPTIC TR("Vib. strøm til/fra","Vibrator strøm til/fra") #define TR_THROTTLE_WARNING TR("Gas adv", "Gas advarsel") #define TR_CUSTOM_THROTTLE_WARNING TR("Tilp-Pos", "Tilpasset position?") diff --git a/radio/src/translations/de.h b/radio/src/translations/de.h index 3dc4af69eb3..7b795a34659 100644 --- a/radio/src/translations/de.h +++ b/radio/src/translations/de.h @@ -397,6 +397,7 @@ #define TR_PLAY_HELLO "Startton abspielen" #define TR_PWR_ON_DELAY "PWR EIN Verzög." #define TR_PWR_OFF_DELAY "PWR AUS Verzög." +#define TR_PWR_AUTO_OFF TR("Pwr Auto Off","Power Auto Off") #define TR_PWR_ON_OFF_HAPTIC TR("Pwr AN/AUS Haptik","Power AN/AUS Haptik") #define TR_THROTTLE_WARNING TR("Gasalarm", "Gas Alarm") #define TR_CUSTOM_THROTTLE_WARNING TR("Cust-Pos", "Custom position?") diff --git a/radio/src/translations/en.h b/radio/src/translations/en.h index 1683780ceea..bf47a79d465 100644 --- a/radio/src/translations/en.h +++ b/radio/src/translations/en.h @@ -393,6 +393,7 @@ #define TR_PLAY_HELLO "Startup Sound" #define TR_PWR_ON_DELAY "Pwr On delay" #define TR_PWR_OFF_DELAY "Pwr Off delay" +#define TR_PWR_AUTO_OFF TR("Pwr Auto Off","Power Auto Off") #define TR_PWR_ON_OFF_HAPTIC TR("Pwr ON/OFF Haptic","Power ON/OFF Haptic") #define TR_THROTTLE_WARNING TR("T-Warning", "Throttle state") #define TR_CUSTOM_THROTTLE_WARNING TR("Cust-Pos", "Custom position?") diff --git a/radio/src/translations/es.h b/radio/src/translations/es.h index 28547e5ecb5..fe1c004013e 100644 --- a/radio/src/translations/es.h +++ b/radio/src/translations/es.h @@ -393,6 +393,7 @@ #define TR_PLAY_HELLO "Startup Sound" #define TR_PWR_ON_DELAY TR("Atraso On", "Atraso encendido") #define TR_PWR_OFF_DELAY TR("Atraso Off", "Atraso apagado") +#define TR_PWR_AUTO_OFF TR("Pwr Auto Off","Power Auto Off") #define TR_PWR_ON_OFF_HAPTIC TR("Pwr ON/OFF Haptic","Power ON/OFF Haptic") #define TR_THROTTLE_WARNING TR("Aviso-A", "Aviso acelerador") #define TR_CUSTOM_THROTTLE_WARNING TR("Cust-Pos", "Custom position?") diff --git a/radio/src/translations/fi.h b/radio/src/translations/fi.h index fc90ff0025a..7c10ba9c8f8 100644 --- a/radio/src/translations/fi.h +++ b/radio/src/translations/fi.h @@ -407,6 +407,7 @@ #define TR_PLAY_HELLO "Startup Sound" #define TR_PWR_ON_DELAY "Pwr On delay" #define TR_PWR_OFF_DELAY "Pwr Off delay" +#define TR_PWR_AUTO_OFF TR("Pwr Auto Off","Power Auto Off") #define TR_PWR_ON_OFF_HAPTIC TR("Pwr ON/OFF Haptic","Power ON/OFF Haptic") #define TR_THROTTLE_WARNING TR("T-Warning", "Throttle Warning") #define TR_CUSTOM_THROTTLE_WARNING TR("Cust-Pos", "Custom position?") diff --git a/radio/src/translations/fr.h b/radio/src/translations/fr.h index 22ed0e9c71f..3532675c9a2 100644 --- a/radio/src/translations/fr.h +++ b/radio/src/translations/fr.h @@ -401,6 +401,7 @@ #define TR_PLAY_HELLO "Son de démarrage" #define TR_PWR_ON_DELAY "Délai btn ON" #define TR_PWR_OFF_DELAY "Délai btn OFF" +#define TR_PWR_AUTO_OFF TR("Pwr Auto Off","Power Auto Off") #define TR_PWR_ON_OFF_HAPTIC TR("Pwr ON/OFF Vibreur","Power ON/OFF Vibreur") #define TR_THROTTLE_WARNING TR("Alerte gaz", "Alerte gaz") #define TR_CUSTOM_THROTTLE_WARNING TR("Pos. Perso", "Position perso ?") diff --git a/radio/src/translations/he.h b/radio/src/translations/he.h index c797fc4f84d..0be71a4ed85 100644 --- a/radio/src/translations/he.h +++ b/radio/src/translations/he.h @@ -399,6 +399,7 @@ #define TR_PLAY_HELLO "צליל אתחול" #define TR_PWR_ON_DELAY "השהיית הפעלה פעיל" #define TR_PWR_OFF_DELAY "משך לחיצה לכיבוי השלט" +#define TR_PWR_AUTO_OFF TR("Pwr Auto Off","Power Auto Off") #define TR_PWR_ON_OFF_HAPTIC TR("Pwr ON/OFF Haptic","Power ON/OFF Haptic") #define TR_THROTTLE_WARNING TR("T-Warning", "התראת מצערת פתוחה") #define TR_CUSTOM_THROTTLE_WARNING TR("Cust-Pos", "עריכת מיקום ידנית") diff --git a/radio/src/translations/it.h b/radio/src/translations/it.h index e23844ec85d..dfd572c4806 100644 --- a/radio/src/translations/it.h +++ b/radio/src/translations/it.h @@ -395,6 +395,7 @@ #define TR_PLAY_HELLO "Suono all'accensione" #define TR_PWR_ON_DELAY "Rit. accens." #define TR_PWR_OFF_DELAY "Rit. spegni." +#define TR_PWR_AUTO_OFF TR("Pwr Auto Off","Power Auto Off") #define TR_PWR_ON_OFF_HAPTIC TR("Vibraz. Pwr ON/OFF","Vibrazione Pwr ON/OFF") #define TR_THROTTLE_WARNING TR("All. Mot.", "Allarme Motore") #define TR_CUSTOM_THROTTLE_WARNING TR("Cust-Pos", "Custom position?") diff --git a/radio/src/translations/jp.h b/radio/src/translations/jp.h index ba5c4a5ccf4..6b2cd218599 100644 --- a/radio/src/translations/jp.h +++ b/radio/src/translations/jp.h @@ -394,6 +394,7 @@ #define TR_PLAY_HELLO "起動時サウンド" #define TR_PWR_ON_DELAY "電源ON遅延" #define TR_PWR_OFF_DELAY "電源OFF遅延" +#define TR_PWR_AUTO_OFF TR("Pwr Auto Off","Power Auto Off") #define TR_PWR_ON_OFF_HAPTIC TR("Pwr ON/OFF Haptic","電源 ON/OFF 時のバイブ") #define TR_THROTTLE_WARNING TR("T-Warning", "Throttle状態") #define TR_CUSTOM_THROTTLE_WARNING TR("Cust-Pos", "カスタム位置?") diff --git a/radio/src/translations/nl.h b/radio/src/translations/nl.h index e9f8606b954..ba0fd0735b7 100644 --- a/radio/src/translations/nl.h +++ b/radio/src/translations/nl.h @@ -393,6 +393,7 @@ #define TR_PLAY_HELLO "Startup Sound" #define TR_PWR_ON_DELAY "Pwr On delay" #define TR_PWR_OFF_DELAY "Pwr Off delay" +#define TR_PWR_AUTO_OFF TR("Pwr Auto Off","Power Auto Off") #define TR_PWR_ON_OFF_HAPTIC TR("Pwr ON/OFF Haptic","Power ON/OFF Haptic") #define TR_THROTTLE_WARNING TR("T-Warning", "Throttle Status") #define TR_CUSTOM_THROTTLE_WARNING TR("Cust-Pos", "Custom position?") diff --git a/radio/src/translations/pl.h b/radio/src/translations/pl.h index 4db64777eaf..cc974fcf637 100644 --- a/radio/src/translations/pl.h +++ b/radio/src/translations/pl.h @@ -392,6 +392,7 @@ #define TR_PLAY_HELLO "Dźwięk uruchomienia" #define TR_PWR_ON_DELAY "Pwr On delay" #define TR_PWR_OFF_DELAY "Pwr Off delay" +#define TR_PWR_AUTO_OFF TR("Pwr Auto Off","Power Auto Off") #define TR_PWR_ON_OFF_HAPTIC TR("Wibracja włączania","Wibracja włączania") #define TR_THROTTLE_WARNING TR("OstrzGaz", "OstrzeżenieGaz") #define TR_CUSTOM_THROTTLE_WARNING TR("InnePoł", "Inne położenie?") diff --git a/radio/src/translations/pt.h b/radio/src/translations/pt.h index e6be5ed2a13..d136e875c4f 100644 --- a/radio/src/translations/pt.h +++ b/radio/src/translations/pt.h @@ -398,6 +398,7 @@ #define TR_PLAY_HELLO "Som ao ligar" #define TR_PWR_ON_DELAY "Delay para LIGA" #define TR_PWR_OFF_DELAY "Delay para DESL" +#define TR_PWR_AUTO_OFF TR("Pwr Auto Off","Power Auto Off") #define TR_PWR_ON_OFF_HAPTIC TR("Vibra ao LIG/DESL", "Vibrar ao Lig/Desl") #define TR_THROTTLE_WARNING TR("A-Aceler.", "Pos do acelerador") #define TR_CUSTOM_THROTTLE_WARNING TR("Cust-Pos", "Custom position?") diff --git a/radio/src/translations/se.h b/radio/src/translations/se.h index eb24e3ba39b..fbc7fb1045f 100644 --- a/radio/src/translations/se.h +++ b/radio/src/translations/se.h @@ -407,6 +407,7 @@ #define TR_PLAY_HELLO "Startljud" #define TR_PWR_ON_DELAY "Fördröj start" #define TR_PWR_OFF_DELAY "Fördröj avslut" +#define TR_PWR_AUTO_OFF TR("Pwr Auto Off","Power Auto Off") #define TR_PWR_ON_OFF_HAPTIC TR("Tx AV/PÅ vibr.","Radio AV/PÅ vibration") #define TR_BLCOLOR "Färg" #define TR_THROTTLE_WARNING TR("Gasvarn.", "Gasvarning") diff --git a/radio/src/translations/tw.h b/radio/src/translations/tw.h index 8fb30e77187..3d6c033e8a9 100644 --- a/radio/src/translations/tw.h +++ b/radio/src/translations/tw.h @@ -396,6 +396,7 @@ #define TR_PLAY_HELLO "開機語音" #define TR_PWR_ON_DELAY "開機延遲" #define TR_PWR_OFF_DELAY "關機延遲" +#define TR_PWR_AUTO_OFF TR("Pwr Auto Off","Power Auto Off") #define TR_PWR_ON_OFF_HAPTIC TR("開關機震動","開關機震動提示") #define TR_THROTTLE_WARNING TR("油門狀態", "油門狀態") #define TR_CUSTOM_THROTTLE_WARNING TR("自定位置", "自定油門位置?")