Add RC Rate Yaw as adjustment function

10.3.x-maintenance
KiteAnton 2016-08-08 23:17:22 +02:00
parent b4ce967453
commit e7cacef851
3 changed files with 19 additions and 3 deletions

View File

@ -1097,6 +1097,10 @@
"adjustmentsFunction20": {
"message": "Roll D Adjustment"
},
"adjustmentsFunction21": {
"message": "RC Rate Yaw"
},
"adjustmentsSave": {
"message": "Save"
},

View File

@ -88,6 +88,7 @@
<option value="18" i18n="adjustmentsFunction18"></option>
<option value="19" i18n="adjustmentsFunction19"></option>
<option value="20" i18n="adjustmentsFunction20"></option>
<option value="21" i18n="adjustmentsFunction21"></option>
</select></td>
<td class="adjustmentSlot"><select class="slot">
<option value="0" i18n="adjustmentsSlot0"></option>

View File

@ -57,14 +57,25 @@ TABS.adjustments.initialize = function (callback) {
//
// update selected function
//
var functionList = $(newAdjustment).find('.functionSelection .function');
functionList.val(adjustmentRange.adjustmentFunction);
// update list of selected functions
var functionListOptions = $(functionList).find('option');
var availableFunctionCount = 21; // Available in betaflight 2.9
if (semver.gte(CONFIG.flightControllerVersion, '3.1.0')) {
availableFunctionCount += 1; // RC rate Yaw added to 3.1.0
}
var functionListOptions = $(functionListOptions).slice(0,availableFunctionCount);
functionList.empty().append(functionListOptions);
functionList.val(adjustmentRange.adjustmentFunction);
//
// populate function channel select box
//
var channelList = $(newAdjustment).find('.functionSwitchChannel .channel');
var channelOptionTemplate = $(channelList).find('option');
channelOptionTemplate.remove();