mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-16 04:45:18 +03:00
Refactor how port names as derived
This commit is contained in:
parent
9f065fc1a6
commit
a0af3d998b
3 changed files with 21 additions and 17 deletions
|
@ -133,6 +133,20 @@ helper.serialPortHelper = (function () {
|
|||
'MSP_DISPLAYPORT': 25,
|
||||
};
|
||||
|
||||
privateScope.identifierToName = {
|
||||
0: 'UART1',
|
||||
1: 'UART2',
|
||||
2: 'UART3',
|
||||
3: 'UART4',
|
||||
4: 'UART5',
|
||||
5: 'UART6',
|
||||
6: 'UART7',
|
||||
7: 'UART8',
|
||||
20: 'USB VCP',
|
||||
30: 'SOFTSERIAL1',
|
||||
31: 'SOFTSERIAL2'
|
||||
};
|
||||
|
||||
privateScope.generateNames = function () {
|
||||
if (privateScope.namesGenerated) {
|
||||
return;
|
||||
|
@ -187,5 +201,9 @@ helper.serialPortHelper = (function () {
|
|||
return functions;
|
||||
};
|
||||
|
||||
publicScope.getPortName = function (identifier) {
|
||||
return privateScope.identifierToName[identifier];
|
||||
};
|
||||
|
||||
return publicScope;
|
||||
})();
|
Loading…
Add table
Add a link
Reference in a new issue