mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-23 16:25:22 +03:00
Disable motor protocols not included in build (#4373)
* Disable motor protocols not included in build * Fix backwards compatibility
This commit is contained in:
parent
f15214ac2d
commit
bdcf41b56d
2 changed files with 6 additions and 4 deletions
|
@ -704,9 +704,11 @@ motors.initialize = async function (callback) {
|
|||
const escProtocols = EscProtocols.GetAvailableProtocols(FC.CONFIG.apiVersion);
|
||||
const escProtocolElement = $("select.escprotocol");
|
||||
|
||||
for (let j = 0; j < escProtocols.length; j++) {
|
||||
escProtocolElement.append(`<option value="${j + 1}">${escProtocols[j]}</option>`);
|
||||
}
|
||||
escProtocols.forEach((protocol, index) => {
|
||||
const isDisabled = protocol !== "DISABLED" && FC.CONFIG.buildOptions.length && !FC.CONFIG.buildOptions.some(option => protocol.includes(option.substring(4))) ? "disabled" : "";
|
||||
const option = `<option value="${index + 1}" ${isDisabled}>${protocol}</option>`;
|
||||
escProtocolElement.append(option);
|
||||
});
|
||||
|
||||
escProtocolElement.sortSelect("DISABLED");
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class EscProtocols {
|
||||
static get PROTOCOL_PWM() {
|
||||
return "PWM";
|
||||
return "PWM_OUTPUT";
|
||||
}
|
||||
static get PROTOCOL_ONESHOT125() {
|
||||
return "ONESHOT125";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue