Added bind button for receivers that support it.
parent
2925646d82
commit
c2575935fc
|
@ -1952,6 +1952,9 @@
|
||||||
"receiverButtonRefresh": {
|
"receiverButtonRefresh": {
|
||||||
"message": "Refresh"
|
"message": "Refresh"
|
||||||
},
|
},
|
||||||
|
"receiverButtonBind": {
|
||||||
|
"message": "Bind Receiver"
|
||||||
|
},
|
||||||
"receiverButtonSticks": {
|
"receiverButtonSticks": {
|
||||||
"message": "Control sticks"
|
"message": "Control sticks"
|
||||||
},
|
},
|
||||||
|
|
|
@ -633,6 +633,7 @@ var FC = {
|
||||||
HAS_FLASH_BOOTLOADER: 3,
|
HAS_FLASH_BOOTLOADER: 3,
|
||||||
SUPPORTS_CUSTOM_DEFAULTS: 4,
|
SUPPORTS_CUSTOM_DEFAULTS: 4,
|
||||||
HAS_CUSTOM_DEFAULTS: 5,
|
HAS_CUSTOM_DEFAULTS: 5,
|
||||||
|
SUPPORTS_RX_BIND: 6,
|
||||||
},
|
},
|
||||||
|
|
||||||
boardHasVcp: function () {
|
boardHasVcp: function () {
|
||||||
|
|
|
@ -173,7 +173,10 @@ var MSPCodes = {
|
||||||
MSP_DEBUGMSG: 253, // Not used
|
MSP_DEBUGMSG: 253, // Not used
|
||||||
MSP_DEBUG: 254,
|
MSP_DEBUG: 254,
|
||||||
|
|
||||||
// MSPv2
|
// MSPv2 Common
|
||||||
MSP2_COMMON_SERIAL_CONFIG: 0x1009,
|
MSP2_COMMON_SERIAL_CONFIG: 0x1009,
|
||||||
MSP2_COMMON_SET_SERIAL_CONFIG: 0x100A,
|
MSP2_COMMON_SET_SERIAL_CONFIG: 0x100A,
|
||||||
|
|
||||||
|
// MSPv2 Betaflight specific
|
||||||
|
MSP2_BETAFLIGHT_BIND: 0x3000,
|
||||||
};
|
};
|
||||||
|
|
|
@ -325,6 +325,16 @@ TABS.receiver.initialize = function (callback) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let showBindButton = false;
|
||||||
|
if (semver.gte(CONFIG.apiVersion, "1.43.0")) {
|
||||||
|
showBindButton = bit_check(CONFIG.targetCapabilities, FC.TARGET_CAPABILITIES_FLAGS.SUPPORTS_RX_BIND);
|
||||||
|
|
||||||
|
$("a.bind").click(function() {
|
||||||
|
MSP.send_message(MSPCodes.MSP2_BETAFLIGHT_BIND);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
$(".bind_btn").toggle(showBindButton);
|
||||||
|
|
||||||
// RC Smoothing
|
// RC Smoothing
|
||||||
if (semver.gte(CONFIG.apiVersion, "1.40.0")) {
|
if (semver.gte(CONFIG.apiVersion, "1.40.0")) {
|
||||||
$('.tab-receiver .rcSmoothing').show();
|
$('.tab-receiver .rcSmoothing').show();
|
||||||
|
|
|
@ -315,6 +315,9 @@
|
||||||
<div class="btn sticks_btn">
|
<div class="btn sticks_btn">
|
||||||
<a class="sticks" href="#" i18n="receiverButtonSticks"></a>
|
<a class="sticks" href="#" i18n="receiverButtonSticks"></a>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="btn bind_btn">
|
||||||
|
<a class="bind" href="#" i18n="receiverButtonBind"></a>
|
||||||
|
</div>
|
||||||
<div class="btn refresh_btn">
|
<div class="btn refresh_btn">
|
||||||
<a class="refresh" href="#" i18n="receiverButtonRefresh"></a>
|
<a class="refresh" href="#" i18n="receiverButtonRefresh"></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue