forked from betaflight/betaflight-configurator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust peripherals mode name in failsafe tab
The failsafe tab does not adjust the real name of the MODE for peripherals. Only the MODES tab do it.
- Loading branch information
1 parent
d55f22b
commit 6054e69
Showing
4 changed files
with
46 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
'use strict'; | ||
|
||
// return true if user has choose a special peripheral | ||
function isPeripheralSelected(peripheralName) { | ||
for (var portIndex = 0; portIndex < SERIAL_CONFIG.ports.length; portIndex++) { | ||
var serialPort = SERIAL_CONFIG.ports[portIndex]; | ||
if (serialPort.functions.indexOf(peripheralName) >= 0) { | ||
return true; | ||
} | ||
} | ||
|
||
return false; | ||
} | ||
|
||
// Adjust the real name for a modeId. Useful if it belongs to a peripheral | ||
function adjustBoxNameIfPeripheralWithModeID(modeId, defaultName) { | ||
if (isPeripheralSelected("RUNCAM_SPLIT_CONTROL")) { | ||
switch (modeId) { | ||
case 32: // BOXCAMERA1 | ||
return chrome.i18n.getMessage('modeCameraWifi'); | ||
case 33: // BOXCAMERA2 | ||
return chrome.i18n.getMessage('modeCameraPower'); | ||
case 34: // BOXCAMERA3 | ||
return chrome.i18n.getMessage('modeCameraChangeMode'); | ||
default: | ||
return defaultName; | ||
} | ||
} | ||
|
||
return defaultName; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters