1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-15 20:35:17 +03:00

Multipos improvements

This commit is contained in:
Andre Bernet 2016-08-31 21:48:15 +02:00
parent 9c966515f2
commit 38886e31a4
3 changed files with 11 additions and 4 deletions

View file

@ -239,7 +239,11 @@ void generalDefault()
g_eeGeneral.vBatMin = -60; // 0 is 9.0V g_eeGeneral.vBatMin = -60; // 0 is 9.0V
g_eeGeneral.vBatMax = -78; // 0 is 12.0V g_eeGeneral.vBatMax = -78; // 0 is 12.0V
#elif defined(PCBHORUS) #elif defined(PCBHORUS)
g_eeGeneral.potsConfig = 0x19; // S1 and S2 = pots with detent #if PCBREV >= 13
g_eeGeneral.potsConfig = 0x1B; // S1 = pot, 6P = multipos, S2 = pot with detent
#else
g_eeGeneral.potsConfig = 0x19; // S1 = pot without detent, 6P = multipos, S2 = pot with detent
#endif
g_eeGeneral.slidersConfig = 0x0f; // 4 sliders g_eeGeneral.slidersConfig = 0x0f; // 4 sliders
g_eeGeneral.blOffBright = 20; g_eeGeneral.blOffBright = 20;
#elif defined(PCBTARANIS) #elif defined(PCBTARANIS)

View file

@ -300,8 +300,8 @@
void memswap(void * a, void * b, uint8_t size); void memswap(void * a, void * b, uint8_t size);
#if defined(PCBHORUS) #if defined(PCBHORUS)
#define IS_POT_MULTIPOS(x) ((x)==POT2) #define IS_POT_MULTIPOS(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_MULTIPOS_SWITCH)
#define IS_POT_WITHOUT_DETENT(x) (true) #define IS_POT_WITHOUT_DETENT(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_WITHOUT_DETENT)
#elif defined(PCBFLAMENCO) #elif defined(PCBFLAMENCO)
#define IS_POT_MULTIPOS(x) (false) #define IS_POT_MULTIPOS(x) (false)
#define IS_POT_WITHOUT_DETENT(x) (false) #define IS_POT_WITHOUT_DETENT(x) (false)

View file

@ -246,7 +246,10 @@ char * getSwitchString(char * dest, swsrc_t idx)
#if NUM_XPOTS > 0 #if NUM_XPOTS > 0
else if (idx <= SWSRC_LAST_MULTIPOS_SWITCH) { else if (idx <= SWSRC_LAST_MULTIPOS_SWITCH) {
div_t swinfo = div(idx - SWSRC_FIRST_MULTIPOS_SWITCH, XPOTS_MULTIPOS_COUNT); div_t swinfo = div(idx - SWSRC_FIRST_MULTIPOS_SWITCH, XPOTS_MULTIPOS_COUNT);
strAppendStringWithIndex(s, "S", swinfo.quot*10+swinfo.rem+11); char temp[LEN_ANA_NAME+1];
getSourceString(temp, MIXSRC_FIRST_POT+swinfo.quot);
temp[LEN_ANA_NAME]= '\0';
strAppendStringWithIndex(s, temp, swinfo.rem+1);
} }
#endif #endif
else if (idx <= SWSRC_LAST_TRIM) { else if (idx <= SWSRC_LAST_TRIM) {