1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-23 08:15:22 +03:00

Merge pull request #1905 from Asizon/dynamicIdle

Dynamic Idle configurable
This commit is contained in:
Michael Keller 2020-03-06 08:23:12 +13:00 committed by GitHub
commit 94bd817aff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 30 additions and 6 deletions

View file

@ -460,6 +460,7 @@ var FC = {
integratedYawRelax: 0,
motorOutputLimit: 0,
autoProfileCellCount: 0,
idleMinRpm: 0,
};
ADVANCED_TUNING_ACTIVE = { ...ADVANCED_TUNING };

View file

@ -1146,6 +1146,7 @@ MspHelper.prototype.process_data = function(dataHandler) {
if(semver.gte(CONFIG.apiVersion, "1.43.0")) {
ADVANCED_TUNING.motorOutputLimit = data.readU8();
ADVANCED_TUNING.autoProfileCellCount = data.readU8();
ADVANCED_TUNING.idleMinRpm = data.readU8();
}
}
}
@ -2079,7 +2080,8 @@ MspHelper.prototype.crunch = function(code) {
if (semver.gte(CONFIG.apiVersion, "1.43.0")) {
buffer.push8(ADVANCED_TUNING.motorOutputLimit)
.push8(ADVANCED_TUNING.autoProfileCellCount);
.push8(ADVANCED_TUNING.autoProfileCellCount)
.push8(ADVANCED_TUNING.idleMinRpm);
}
}
}

View file

@ -516,9 +516,9 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
$('input[name="motorPoles"]').val(MOTOR_CONFIG.motor_poles);
}
function hideMotorPoles() {
let motorPolesVisible = $("input[id='dshotBidir']").is(':checked') || $("input[name='ESC_SENSOR']").is(':checked');
$('div.motorPoles').toggle(motorPolesVisible);
function hideRpmFeatures() {
let rpmFeaturesVisible = $("input[id='dshotBidir']").is(':checked') || $("input[name='ESC_SENSOR']").is(':checked');
$('div.motorPoles').toggle(rpmFeaturesVisible);
}
$('#escProtocolTooltip').toggle(semver.lt(CONFIG.apiVersion, "1.42.0"));
@ -549,8 +549,8 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
$('div.checkboxDshotBidir').toggle(semver.gte(CONFIG.apiVersion, "1.42.0") && digitalProtocol);
$('div.motorPoles').toggle(semver.gte(CONFIG.apiVersion, "1.42.0"));
//trigger change dshotBidir and ESC_SENSOR to show/hide Motor Poles tab
$("input[id='dshotBidir']").change(hideMotorPoles).change();
$("input[name='ESC_SENSOR']").change(hideMotorPoles);
$("input[id='dshotBidir']").change(hideRpmFeatures).change();
$("input[name='ESC_SENSOR']").change(hideRpmFeatures);
//trigger change unsyncedPWMSwitch to show/hide Motor PWM freq input
$("input[id='unsyncedPWMSwitch']").change();

View file

@ -393,8 +393,10 @@ TABS.pid_tuning.initialize = function (callback) {
if (semver.gte(CONFIG.apiVersion, "1.43.0")) {
$('.pid_tuning input[name="motorLimit"]').val(ADVANCED_TUNING.motorOutputLimit);
$('.pid_tuning input[name="cellCount"]').val(ADVANCED_TUNING.autoProfileCellCount);
$('input[name="idleMinRpm-number"]').val(ADVANCED_TUNING.idleMinRpm);
} else {
$('.motorOutputLimit').hide();
$('.idleMinRpm').hide();
}
$('input[id="useIntegratedYaw"]').change(function() {
@ -776,6 +778,7 @@ TABS.pid_tuning.initialize = function (callback) {
FILTER_CONFIG.dyn_notch_max_hz = parseInt($('.pid_filter input[name="dynamicNotchMaxHz"]').val());
ADVANCED_TUNING.motorOutputLimit = parseInt($('.pid_tuning input[name="motorLimit"]').val());
ADVANCED_TUNING.autoProfileCellCount = parseInt($('.pid_tuning input[name="cellCount"]').val());
ADVANCED_TUNING.idleMinRpm = parseInt($('input[name="idleMinRpm-number"]').val());
}
}