1
0
Fork 0
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:
Mark Haslinghuis 2025-03-10 15:47:38 +01:00 committed by GitHub
parent f15214ac2d
commit bdcf41b56d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View file

@ -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");

View file

@ -1,6 +1,6 @@
class EscProtocols {
static get PROTOCOL_PWM() {
return "PWM";
return "PWM_OUTPUT";
}
static get PROTOCOL_ONESHOT125() {
return "ONESHOT125";