Added DSHOT beacon configuration

10.3.x-maintenance
Bas Delfos 2018-01-31 23:06:04 +01:00
parent 2a002b97ff
commit a204d730bb
5 changed files with 96 additions and 2 deletions

View File

@ -919,6 +919,15 @@
"configurationThrottleMinimumCommandHelp": {
"message": "This is the value that is sent to the ESCs when the craft is disarmed. Set this to a value that has the motors stopped (1000 for most ESCs)."
},
"configurationDshotBeeper": {
"message": "DSHOT Beacon Configuration"
},
"configurationUseDshotBeeper": {
"message": "Use DSHOT beacon (use motors to sound beeps when disarmed)"
},
"configurationDshotBeaconTone": {
"message": "Beacon Tone"
},
"configurationBeeper": {
"message": "Beeper Configuration"
},

View File

@ -104,6 +104,7 @@ var FC = {
BEEPER_CONFIG = {
beepers: 0,
dshotBeaconTone: 0,
};
MIXER_CONFIG = {

View File

@ -602,6 +602,9 @@ MspHelper.prototype.process_data = function(dataHandler) {
case MSPCodes.MSP_BEEPER_CONFIG:
BEEPER_CONFIG.beepers.setMask(data.readU32());
if (semver.gte(CONFIG.apiVersion, "1.37.0")) {
BEEPER_CONFIG.dshotBeaconTone = data.readU8();
}
break;
case MSPCodes.MSP_BOARD_ALIGNMENT_CONFIG:
@ -1201,6 +1204,9 @@ MspHelper.prototype.crunch = function(code) {
case MSPCodes.MSP_SET_BEEPER_CONFIG:
var beeperMask = BEEPER_CONFIG.beepers.getMask();
buffer.push32(beeperMask);
if (semver.gte(CONFIG.apiVersion, "1.37.0")) {
buffer.push8(BEEPER_CONFIG.dshotBeaconTone );
}
break;
case MSPCodes.MSP_SET_MIXER_CONFIG:
buffer.push8(MIXER_CONFIG.mixer)

View File

@ -235,7 +235,38 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
FEATURE_CONFIG.features.generateElements(features_e);
// Beeper
// Dshot Beeper
var dshotBeeper_e = $('.tab-configuration .dshotbeeper');
var dshotBeacon_e = $('.tab-configuration .dshotbeacon');
var dshotBeeperSwitch = $('#dshotBeeperSwitch');
var dshotBeeperBeaconTone = $('#dshotBeeperBeaconTone');
dshotBeeperSwitch.change(function() {
if ($(this).is(':checked')) {
dshotBeacon_e.show();
if (dshotBeeperBeaconTone.val() == 0) {
dshotBeeperBeaconTone.val(1).change();
}
} else {
dshotBeeperBeaconTone.val(0).change();
dshotBeacon_e.hide();
}
});
dshotBeeperBeaconTone.change(function() {
BEEPER_CONFIG.dshotBeaconTone = dshotBeeperBeaconTone.val();
});
dshotBeeperBeaconTone.val(BEEPER_CONFIG.dshotBeaconTone);
dshotBeeperSwitch.prop('checked', BEEPER_CONFIG.dshotBeaconTone !== 0).change();
if (semver.gte(CONFIG.apiVersion, "1.37.0")) {
dshotBeeper_e.show();
} else {
dshotBeeper_e.hide();
}
// Analog Beeper
var template = $('.beepers .beeper-template');
var destination = $('.beepers .beeper-configuration');
var beeper_e = $('.tab-configuration .beepers');

View File

@ -674,9 +674,56 @@
</td>
</tr>
<tr class="dshotbeeper">
<td style="width:calc(50%)" colspan="2">
<!-- ROW 5 - HALF WIDTH PANE -->
<!-- DSHOT BEEPER -->
<div class="dshotBeeper" style="width: calc(50%);">
<div class="gui_box grey" style="margin-top:10px;">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationDshotBeeper"></div>
</div>
<div class="spacer_box">
<table cellpadding="0" cellspacing="0">
<tbody class="dshot-beeper-configuration" id="noline">
<tr>
<td>
<div class="number">
<div style="float: left; height: 20px; margin-right: 34px;">
<input class="dshot-beeper toggle" id="dshotBeeperSwitch" type="checkbox" />
</div>
<label for="dshotBeeperSwitch">
<span i18n="configurationUseDshotBeeper"></span>
</label>
</div>
</td>
</tr>
<tr class="dshotbeacon">
<td>
<div class="number">
<div style="float: left; height: 20px; margin-right: 10px;">
<input type="number" id="dshotBeeperBeaconTone" step="1" min="1" max="5" />
</div>
<label for="dshotBeeperBeaconTone">
<span i18n="configurationDshotBeaconTone"></span>
</label>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</td>
</tr>
<tr class="beepers">
<td style="width:calc(100%)" colspan="2">
<!-- ROW 4 - FULL WIDTH PANE -->
<!-- ROW 6 - FULL WIDTH PANE -->
<!-- BEEPER -->
<div class="beepers" style="width: calc(100%);">