Issue #192 - Trims and Rotary encoders buttons added to the switches

list
This commit is contained in:
Bertrand Songis
2014-02-06 12:45:53 +01:00
parent 46fe25fd24
commit 4a20329b2b
14 changed files with 178 additions and 108 deletions
+19 -3
View File
@@ -1386,9 +1386,24 @@ bool getSwitch(int8_t swtch)
result = SWITCH_POSITION(cs_idx-SWSRC_FIRST_SWITCH);
}
#if defined(PCBTARANIS)
else if (cs_idx >= SWSRC_P11 && cs_idx <= SWSRC_P26) {
else if (cs_idx <= SWSRC_P26) {
result = POT_POSITION(cs_idx-SWSRC_P11);
}
#endif
#if defined(CPUARM)
else if (cs_idx <= SWSRC_LAST_TRIM) {
result = readTrims() & (1 << (cs_idx-SWSRC_FIRST_TRIM));
}
#endif
#if ROTARY_ENCODERS > 0
else if (cs_idx == SWSRC_REa) {
result = REA_DOWN();
}
#endif
#if ROTARY_ENCODERS > 1
else if (cs_idx == SWSRC_REb) {
result = REB_DOWN();
}
#endif
else {
cs_idx -= SWSRC_FIRST_CSW;
@@ -3072,8 +3087,9 @@ void evalFunctions()
}
#if defined(GVARS)
for (uint8_t i=0; i<NUM_STICKS; i++)
for (uint8_t i=0; i<NUM_STICKS; i++) {
trimGvar[i] = -1;
}
#endif
for (uint8_t i=0; i<NUM_CFN; i++) {
@@ -4175,7 +4191,7 @@ void opentxClose()
hapticOff();
#endif
#if defined(CPUARM)
#if defined(CPUARM) && defined(FRSKY)
if((g_model.frsky.mAhPersistent) && (g_model.frsky.storedMah != frskyData.hub.currentConsumption)) {
g_model.frsky.storedMah = frskyData.hub.currentConsumption;
eeDirty(EE_MODEL);