mirror of
https://github.com/opentx/opentx.git
synced 2025-07-25 01:05:10 +03:00
[Taranis] Automatic detection of the 6pos switch within the calibration
process
This commit is contained in:
parent
33eeb4cc64
commit
e4b3b3af85
5 changed files with 137 additions and 38 deletions
|
@ -1263,7 +1263,14 @@ bool isSwitchAvailable(int16_t swtch)
|
|||
swtch = -swtch;
|
||||
}
|
||||
|
||||
if (swtch>=SWSRC_FIRST_CSW && swtch<=SWSRC_LAST_CSW) {
|
||||
#if defined(PCBTARANIS)
|
||||
if (swtch >= SWSRC_P11 && swtch <= SWSRC_P26) {
|
||||
int index = (swtch - SWSRC_P11) / 6;
|
||||
return (g_eeGeneral.potsType & (1<<index));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (swtch >= SWSRC_FIRST_CSW && swtch <= SWSRC_LAST_CSW) {
|
||||
CustomSwData * cs = cswAddress(swtch-SWSRC_FIRST_CSW);
|
||||
return (cs->func != CS_OFF);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue