Skip to content

Commit b3989bd

Browse files
committed
RFC Dynamic Idle
1 parent dd183f0 commit b3989bd

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

locales/en/messages.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,6 +1281,9 @@
12811281
"configurationDigitalIdlePercent": {
12821282
"message": "Motor Idle Throttle Value [percent]"
12831283
},
1284+
"configurationDigitalIdlePercentDisabled": {
1285+
"message": "Motor Idle Throttle Value [percent] is disabled because Dynamic Idle is enabled in PID tuning tab"
1286+
},
12841287
"configurationDigitalIdlePercentHelp": {
12851288
"message": "The 'DShot idle' value is the percent of maximum throttle that is sent to the ESCs when the throttle at minimum stick position and the craft is armed. Increase it to gain more idle speed and avoid desyncs. Too high and the craft feels floaty."
12861289
},

src/js/tabs/motors.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ TABS.motors.initialize = function (callback) {
6161
}
6262

6363
MSP.promise(MSPCodes.MSP_STATUS)
64+
.then(() => MSP.promise(MSPCodes.MSP_PID_ADVANCED))
6465
.then(() => MSP.promise(MSPCodes.MSP_FEATURE_CONFIG))
6566
.then(() => MSP.promise(MSPCodes.MSP_MIXER_CONFIG))
6667
.then(() => FC.MOTOR_CONFIG.use_dshot_telemetry || FC.MOTOR_CONFIG.use_esc_sensor ? MSP.promise(MSPCodes.MSP_MOTOR_TELEMETRY) : true)
@@ -735,6 +736,15 @@ TABS.motors.initialize = function (callback) {
735736
divUnsyncedPWMFreq.toggle(protocolConfigured && !digitalProtocol);
736737

737738
$('div.digitalIdlePercent').toggle(protocolConfigured && digitalProtocol);
739+
740+
$('input[name="digitalIdlePercent"]').prop('disabled', protocolConfigured && digitalProtocol && FC.ADVANCED_TUNING.idleMinRpm && FC.MOTOR_CONFIG.use_dshot_telemetry);
741+
742+
if (FC.ADVANCED_TUNING.idleMinRpm && FC.MOTOR_CONFIG.use_dshot_telemetry) {
743+
$('span.digitalIdlePercentDisabled').text(i18n.getMessage('configurationDigitalIdlePercentDisabled'));
744+
} else {
745+
$('span.digitalIdlePercentDisabled').text(i18n.getMessage('configurationDigitalIdlePercent'));
746+
}
747+
738748
$('.escSensor').toggle(protocolConfigured && digitalProtocol);
739749

740750
$('div.checkboxDshotBidir').toggle(protocolConfigured && semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_42) && digitalProtocol);

src/js/tabs/pid_tuning.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ TABS.pid_tuning.initialize = function (callback) {
457457
$('.pid_tuning input[name="motorLimit"]').val(FC.ADVANCED_TUNING.motorOutputLimit);
458458
$('.pid_tuning input[name="cellCount"]').val(FC.ADVANCED_TUNING.autoProfileCellCount);
459459
$('input[name="idleMinRpm-number"]').val(FC.ADVANCED_TUNING.idleMinRpm);
460+
$('.idleMinRpm').toggle(FC.MOTOR_CONFIG.use_dshot_telemetry);
460461
} else {
461462
$('.motorOutputLimit').hide();
462463
$('.idleMinRpm').hide();

src/tabs/motors.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@
105105
<div class="numberspacer">
106106
<input type="number" name="digitalIdlePercent" min="0.00" max="20.00" step="0.01"/>
107107
</div>
108-
<span i18n="configurationDigitalIdlePercent"></span>
108+
<span class="digitalIdlePercentDisabled"></span>
109+
<div class="helpicon cf_tip" i18n_title="configurationDigitalIdlePercentHelp"></div>
109110
</label>
110-
<div class="helpicon cf_tip" i18n_title="configurationDigitalIdlePercentHelp"></div>
111111
</div>
112112
<div class="number minthrottle">
113113
<label>

0 commit comments

Comments
 (0)