mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-20 06:45:12 +03:00
Fixed reverse motor direction compatibility with 3.1
This commit is contained in:
parent
9d240fb575
commit
f30826877f
3 changed files with 126 additions and 6 deletions
|
@ -557,7 +557,9 @@ MspHelper.prototype.process_data = function(dataHandler) {
|
|||
|
||||
case MSPCodes.MSP_MIXER_CONFIG:
|
||||
MIXER_CONFIG.mixer = data.readU8();
|
||||
if (semver.lt(CONFIG.apiVersion, "1.36.0")) {
|
||||
MIXER_CONFIG.reverseMotorDir = data.readU8();
|
||||
}
|
||||
break;
|
||||
|
||||
case MSPCodes.MSP_FEATURE_CONFIG:
|
||||
|
@ -1161,7 +1163,9 @@ MspHelper.prototype.crunch = function(code) {
|
|||
break;
|
||||
case MSPCodes.MSP_SET_MIXER_CONFIG:
|
||||
buffer.push8(MIXER_CONFIG.mixer)
|
||||
.push8(MIXER_CONFIG.reverseMotorDir);
|
||||
if (semver.lt(CONFIG.apiVersion, "1.36.0")) {
|
||||
buffer.push8(MIXER_CONFIG.reverseMotorDir);
|
||||
}
|
||||
break;
|
||||
case MSPCodes.MSP_SET_BOARD_ALIGNMENT_CONFIG:
|
||||
buffer.push16(BOARD_ALIGNMENT_CONFIG.roll)
|
||||
|
|
|
@ -528,6 +528,116 @@
|
|||
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="oldBatteryConfig">
|
||||
<td style="width:calc(50%);vertical-align:top;">
|
||||
<!-- ROW 4 - LEFT PANE - ONLY NEEDED FOR BATTERY/CURRENT PART FOR PRE BF3.2 -->
|
||||
|
||||
<!-- -------------------------------------------------------- -->
|
||||
<!-- Remove this part when we officialy retire BF 3.1.x -->
|
||||
<div class="rightWrapper current voltage">
|
||||
<div class="gui_box grey">
|
||||
<div class="gui_box_titlebar">
|
||||
<div class="spacer_box_title" i18n="configurationBatteryVoltage"></div>
|
||||
</div>
|
||||
<div class="spacer_box">
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th i18n="configurationFeatureEnabled"></th>
|
||||
<th i18n="configurationFeatureDescription"></th>
|
||||
<th i18n="configurationFeatureName"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="features batteryVoltage">
|
||||
<!-- table generated here -->
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="select batterymetertype vbatmonitoring">
|
||||
<label>
|
||||
<select class="batterymetertype"><!-- list generated here --></select>
|
||||
<span i18n="configurationBatteryMeterType"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="number vbatmonitoring">
|
||||
<label> <input type="number" name="mincellvoltage" step="0.1" min="1" max="5" /> <span
|
||||
i18n="configurationBatteryMinimum"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="number vbatmonitoring">
|
||||
<label> <input type="number" name="maxcellvoltage" step="0.1" min="1" max="5" /> <span
|
||||
i18n="configurationBatteryMaximum"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="number vbatmonitoring">
|
||||
<label> <input type="number" name="warningcellvoltage" step="0.1" min="1" max="5" /> <span
|
||||
i18n="configurationBatteryWarning"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="number vbatmonitoring vbatCalibration">
|
||||
<label> <input type="number" name="voltagescale" step="1" min="10" max="255" /> <span
|
||||
i18n="configurationBatteryScale"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="number vbatmonitoring">
|
||||
<label> <input type="text" name="batteryvoltage" readonly class="disabled" /> <span
|
||||
i18n="configurationBatteryVoltage"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="gui_box grey">
|
||||
<div class="gui_box_titlebar">
|
||||
<div class="spacer_box_title" i18n="configurationCurrent"></div>
|
||||
</div>
|
||||
<div class="spacer_box">
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th i18n="configurationFeatureEnabled"></th>
|
||||
<th i18n="configurationFeatureDescription"></th>
|
||||
<th i18n="configurationFeatureName"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="features batteryCurrent">
|
||||
<!-- table generated here -->
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="select currentMonitoring">
|
||||
<label>
|
||||
<select class="currentmetertype"><!-- list generated here --></select>
|
||||
<span i18n="configurationCurrentMeterType"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="number currentMonitoring currentCalibration">
|
||||
<label> <input type="number" name="currentscale" step="1" min="-16000" max="16000" /> <span
|
||||
i18n="configurationCurrentScale"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="number currentMonitoring currentCalibration">
|
||||
<label> <input type="number" name="currentoffset" step="1" min="-1600" max="16000" /> <span
|
||||
i18n="configurationCurrentOffset"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="number currentMonitoring currentOutput">
|
||||
<label>
|
||||
<input type="text" name="batterycurrent" readonly class="disabled" /> <span
|
||||
i18n="configurationBatteryCurrent"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox currentMonitoring currentOutput">
|
||||
<div class="numberspacer">
|
||||
<input type="checkbox" name="multiwiicurrentoutput" class="toggle" />
|
||||
</div>
|
||||
<label> <span i18n="configurationBatteryMultiwiiCurrent"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- -------------------------------------------------------- -->
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:calc(100%)" colspan="2">
|
||||
<!-- ROW 4 - FULL WIDTH PANE -->
|
||||
|
|
|
@ -174,12 +174,17 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
|||
|
||||
function refreshMixerPreview() {
|
||||
var mixer = MIXER_CONFIG.mixer
|
||||
var reverse = MIXER_CONFIG.reverseMotorDir ? "_reversed" : "";
|
||||
var reverse = "";
|
||||
|
||||
if (semver.lt(CONFIG.apiVersion, "1.36.0")) {
|
||||
MIXER_CONFIG.reverseMotorDir ? "_reversed" : "";
|
||||
}
|
||||
|
||||
$('.mixerPreview img').attr('src', './resources/motor_order/' + mixerList[mixer - 1].image + reverse + '.svg');
|
||||
};
|
||||
|
||||
var reverseMotorSwitch_e = $('#reverseMotorSwitch');
|
||||
var reverseMotor_e = $('.reverseMotor');
|
||||
|
||||
reverseMotorSwitch_e.change(function() {
|
||||
MIXER_CONFIG.reverseMotorDir = $(this).prop('checked') ? 1 : 0;
|
||||
|
@ -208,6 +213,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
|||
BEEPER_CONFIG.beepers.generateElements(template, destination);
|
||||
} else {
|
||||
beeper_e.hide();
|
||||
reverseMotor_e.hide();
|
||||
}
|
||||
|
||||
// translate to user-selected language
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue