Skip to content

Commit

Permalink
WebUI: prevent multiple I2C SCL/SDA selections (ExpressLRS#2624)
Browse files Browse the repository at this point in the history
* fixes issue ExpressLRS#2623

* do it properly
  • Loading branch information
mha1 authored Mar 31, 2024
1 parent 3c04b8d commit 62faf7f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/html/scan.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ let colorTimer = undefined;
let colorUpdated = false;
let storedModelId = 255;
let buttonActions = [];
let modeSelectionInit = true;
let originalUID = undefined;
let originalUIDType = undefined;

Expand Down Expand Up @@ -156,6 +157,9 @@ function updatePwmSettings(arPwm) {
if (other != index) {
document.querySelectorAll(`#pwm_${other}_mode option`).forEach(opt => {
if (opt.value == value) {
if (modeSelectionInit)
opt.disabled = true;
else
opt.disabled = enable;
}
});
Expand Down Expand Up @@ -184,6 +188,8 @@ function updatePwmSettings(arPwm) {
};
failsafeMode.onchange();
});

modeSelectionInit = false;

// put some contraints on pinRx/Tx mode selects
if (pinRxIndex !== undefined && pinTxIndex !== undefined) {
Expand Down

0 comments on commit 62faf7f

Please sign in to comment.