Skip to content

Commit

Permalink
Merge pull request #1829 from shota3527/mixer_profile
Browse files Browse the repository at this point in the history
mixer profile support
  • Loading branch information
DzikuVx authored Sep 28, 2023
2 parents df23369 + c3b7782 commit 55046e5
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 19 deletions.
20 changes: 8 additions & 12 deletions js/defaults_dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -822,13 +822,11 @@ helper.defaultsDialog = (function () {
key: "nav_fw_launch_climb_angle",
value: 25
},
],
"features": [
{
bit: 4, // Enable MOTOR_STOP
state: true
}
]
key: "motorstop_on_low",
value: "ON"
},
],
},
{
"title": 'Airplane without a Tail (Wing, Delta, etc)',
Expand Down Expand Up @@ -1041,13 +1039,11 @@ helper.defaultsDialog = (function () {
key: "nav_fw_launch_climb_angle",
value: 25
},
],
"features": [
{
bit: 4, // Enable MOTOR_STOP
state: true
}
]
key: "motorstop_on_low",
value: "ON"
},
],
},
{
"title": 'Rovers & Boats',
Expand Down
7 changes: 5 additions & 2 deletions js/fc.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ var FC = {
MIXER_CONFIG = {
yawMotorDirection: 0,
yawJumpPreventionLimit: 0,
motorStopOnLow: false,
platformType: -1,
hasFlaps: false,
appliedMixerPreset: -1,
Expand Down Expand Up @@ -554,7 +555,6 @@ var FC = {
getFeatures: function () {
var features = [
{bit: 1, group: 'batteryVoltage', name: 'VBAT'},
{bit: 4, group: 'other', name: 'MOTOR_STOP'},
{bit: 6, group: 'other', name: 'SOFTSERIAL', haveTip: true, showNameInTip: true},
{bit: 7, group: 'other', name: 'GPS', haveTip: true},
{bit: 10, group: 'other', name: 'TELEMETRY', showNameInTip: true},
Expand Down Expand Up @@ -880,6 +880,7 @@ var FC = {
'GVAR 5', // 35
'GVAR 6', // 36
'GVAR 7', // 37
'Mixer Transition', // 38
];
},
getServoMixInputName: function (input) {
Expand Down Expand Up @@ -1263,11 +1264,13 @@ var FC = {
30: "CRSF SNR",
31: "GPS Valid Fix",
32: "Loiter Radius [cm]",
33: "Active Profile",
33: "Active PIDProfile",
34: "Battery cells",
35: "AGL status [0/1]",
36: "AGL [cm]",
37: "Rangefinder [cm]",
38: "Active MixerProfile",
39: "MixerTransition Active",
}
},
3: {
Expand Down
7 changes: 4 additions & 3 deletions js/msp/MSPHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -1453,7 +1453,8 @@ var mspHelper = (function (gui) {
break;
case MSPCodes.MSP2_INAV_MIXER:
MIXER_CONFIG.yawMotorDirection = data.getInt8(0);
MIXER_CONFIG.yawJumpPreventionLimit = data.getUint16(1, true);
MIXER_CONFIG.yawJumpPreventionLimit = data.getUint8(1, true);
MIXER_CONFIG.motorStopOnLow = data.getUint8(1, true);
MIXER_CONFIG.platformType = data.getInt8(3);
MIXER_CONFIG.hasFlaps = data.getInt8(4);
MIXER_CONFIG.appliedMixerPreset = data.getInt16(5, true);
Expand Down Expand Up @@ -2154,8 +2155,8 @@ var mspHelper = (function (gui) {

case MSPCodes.MSP2_INAV_SET_MIXER:
buffer.push(MIXER_CONFIG.yawMotorDirection);
buffer.push(lowByte(MIXER_CONFIG.yawJumpPreventionLimit));
buffer.push(highByte(MIXER_CONFIG.yawJumpPreventionLimit));
buffer.push(MIXER_CONFIG.yawJumpPreventionLimit);
buffer.push(MIXER_CONFIG.motorStopOnLow);
buffer.push(MIXER_CONFIG.platformType);
buffer.push(MIXER_CONFIG.hasFlaps);
buffer.push(lowByte(MIXER_CONFIG.appliedMixerPreset));
Expand Down
1 change: 0 additions & 1 deletion tabs/mixer.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,6 @@ TABS.mixer.initialize = function (callback, scrollPosition) {
const $fixedValueCalcInput = row.find(".mix-rule-fixed-value");
if (FC.getServoMixInputNames()[$mixRuleInput.val()] === 'MAX') {
$fixedValueCalcInput.show();
row.find(".mix-rule-speed").prop('disabled', true);
} else {
$fixedValueCalcInput.hide();
row.find(".mix-rule-speed").prop('disabled', false);
Expand Down
2 changes: 1 addition & 1 deletion tabs/outputs.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

<div id="motor-stop-warning" data-i18n="motorStopWarning" class="warning-box"></div>
<div class="checkbox">
<input type="checkbox" data-bit="4" class="feature toggle" name="MOTOR_STOP" title="MOTOR_STOP" id="feature-4">
<input id="feature-4" type="checkbox" class="toggle" data-setting="motorstop_on_low" />
<label for="feature-4">
<span data-i18n="featureMOTOR_STOP"></span>
</label>
Expand Down

0 comments on commit 55046e5

Please sign in to comment.