[Taranis X9E] Sliders configuration (LS2 and RS2 will be optional)
This commit is contained in:
@@ -77,11 +77,11 @@ enum menuGeneralHwItems {
|
||||
#define HW_SETTINGS_COLUMN 15*FW
|
||||
|
||||
#if defined(REV9E)
|
||||
#define POTS_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, 0, 0, 0, 0
|
||||
#define POTS_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, 0, 0, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1
|
||||
#elif defined(REVPLUS)
|
||||
#define POTS_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, 0, 0
|
||||
#define POTS_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, 0, 0
|
||||
#else
|
||||
#define POTS_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, 0, 0
|
||||
#define POTS_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, 0, 0
|
||||
#endif
|
||||
|
||||
#if defined(REV9E)
|
||||
@@ -114,10 +114,6 @@ void menuGeneralHardware(uint8_t event)
|
||||
case ITEM_SETUP_HW_STICK4:
|
||||
case ITEM_SETUP_HW_LS:
|
||||
case ITEM_SETUP_HW_RS:
|
||||
#if defined(REV9E)
|
||||
case ITEM_SETUP_HW_LS2:
|
||||
case ITEM_SETUP_HW_RS2:
|
||||
#endif
|
||||
{
|
||||
int idx = (k<=ITEM_SETUP_HW_STICK4 ? k-ITEM_SETUP_HW_STICK1 : k-ITEM_SETUP_HW_LS+MIXSRC_SLIDER1-MIXSRC_Rud);
|
||||
lcd_putsiAtt(INDENT_WIDTH, y, STR_VSRCRAW, idx+1, 0);
|
||||
@@ -127,6 +123,24 @@ void menuGeneralHardware(uint8_t event)
|
||||
lcd_putsiAtt(HW_SETTINGS_COLUMN, y, STR_MMMINV, 0, 0);
|
||||
break;
|
||||
}
|
||||
#if defined(REV9E)
|
||||
case ITEM_SETUP_HW_LS2:
|
||||
case ITEM_SETUP_HW_RS2:
|
||||
{
|
||||
int idx = k - ITEM_SETUP_HW_LS2;
|
||||
uint8_t mask = (0x01 << idx);
|
||||
lcd_putsiAtt(INDENT_WIDTH, y, STR_VSRCRAW, NUM_STICKS+NUM_XPOTS+2+idx+1, m_posHorz < 0 ? attr : 0);
|
||||
if (ZEXIST(g_eeGeneral.anaNames[NUM_STICKS+NUM_XPOTS+2+idx]) || (attr && m_posHorz == 0))
|
||||
editName(HW_SETTINGS_COLUMN, y, g_eeGeneral.anaNames[NUM_STICKS+NUM_XPOTS+2+idx], LEN_ANA_NAME, event, attr && m_posHorz == 0);
|
||||
else
|
||||
lcd_putsiAtt(HW_SETTINGS_COLUMN, y, STR_MMMINV, 0, 0);
|
||||
uint8_t potType = (g_eeGeneral.slidersConfig & mask) >> idx;
|
||||
potType = selectMenuItem(HW_SETTINGS_COLUMN+5*FW, y, "", STR_SLIDERTYPES, potType, SLIDER_NONE, SLIDER_WITH_DETENT, m_posHorz == 1 ? attr : 0, event);
|
||||
g_eeGeneral.slidersConfig &= ~mask;
|
||||
g_eeGeneral.slidersConfig |= (potType << idx);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
case ITEM_SETUP_HW_LABEL_POTS:
|
||||
lcd_putsLeft(y, STR_POTS);
|
||||
break;
|
||||
@@ -147,17 +161,8 @@ void menuGeneralHardware(uint8_t event)
|
||||
editName(HW_SETTINGS_COLUMN, y, g_eeGeneral.anaNames[NUM_STICKS+idx], LEN_ANA_NAME, event, attr && m_posHorz == 0);
|
||||
else
|
||||
lcd_putsiAtt(HW_SETTINGS_COLUMN, y, STR_MMMINV, 0, 0);
|
||||
|
||||
uint8_t potType = (g_eeGeneral.potsConfig & mask) >> shift;
|
||||
#if !defined(REV9E)
|
||||
if (potType == POT_TYPE_NONE && k <= ITEM_SETUP_HW_POT2)
|
||||
potType = POT_TYPE_DETENT;
|
||||
#endif
|
||||
potType = selectMenuItem(HW_SETTINGS_COLUMN+5*FW, y, "", STR_POTTYPES, potType, 0, POT_TYPE_MAX, m_posHorz == 1 ? attr : 0, event);
|
||||
#if !defined(REV9E)
|
||||
if (potType == POT_TYPE_DETENT && k <= ITEM_SETUP_HW_POT2)
|
||||
potType = POT_TYPE_NONE;
|
||||
#endif
|
||||
potType = selectMenuItem(HW_SETTINGS_COLUMN+5*FW, y, "", STR_POTTYPES, potType, POT_NONE, POT_WITHOUT_DETENT, m_posHorz == 1 ? attr : 0, event);
|
||||
g_eeGeneral.potsConfig &= ~mask;
|
||||
g_eeGeneral.potsConfig |= (potType << shift);
|
||||
break;
|
||||
@@ -193,19 +198,11 @@ void menuGeneralHardware(uint8_t event)
|
||||
editName(HW_SETTINGS_COLUMN, y, g_eeGeneral.switchNames[index], LEN_SWITCH_NAME, event, m_posHorz == 0 ? attr : 0);
|
||||
else
|
||||
lcd_putsiAtt(HW_SETTINGS_COLUMN, y, STR_MMMINV, 0, 0);
|
||||
#if defined(REV9E)
|
||||
config = selectMenuItem(HW_SETTINGS_COLUMN+5*FW, y, "", STR_SWTYPES, config, SWITCH_NONE, SWITCH_3POS, m_posHorz == 1 ? attr : 0, event);
|
||||
if (attr && checkIncDec_Ret) {
|
||||
uint64_t mask = (uint64_t)0x07 << (3*index);
|
||||
g_eeGeneral.switchConfig = (g_eeGeneral.switchConfig & ~mask) | ((uint64_t(config) & 0x07) << (3*index));
|
||||
swconfig_t mask = (swconfig_t)0x03 << (2*index);
|
||||
g_eeGeneral.switchConfig = (g_eeGeneral.switchConfig & ~mask) | ((swconfig_t(config) & 0x03) << (2*index));
|
||||
}
|
||||
#else
|
||||
config = selectMenuItem(HW_SETTINGS_COLUMN+5*FW, y, "", STR_SWTYPES, config, SWITCH_DEFAULT, SWITCH_3POS, m_posHorz == 1 ? attr : 0, event);
|
||||
if (attr && checkIncDec_Ret) {
|
||||
uint32_t mask = 0x03 << (2*index);
|
||||
g_eeGeneral.switchConfig = (g_eeGeneral.switchConfig & ~mask) | (((uint32_t)(config) & 0x03) << (2*index));
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case ITEM_SETUP_HW_UART3_MODE:
|
||||
|
||||
@@ -174,6 +174,19 @@ void editTimerMode(int timerIdx, coord_t y, LcdFlags attr, uint8_t event)
|
||||
|
||||
#define CURRENT_MODULE_EDITED(k) (k>=ITEM_MODEL_TRAINER_LABEL ? TRAINER_MODULE : (k>=ITEM_MODEL_EXTERNAL_MODULE_LABEL ? EXTERNAL_MODULE : INTERNAL_MODULE))
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
int getSwitchWarningsCount()
|
||||
{
|
||||
int count = 0;
|
||||
for (int i=0; i<NUM_SWITCHES; ++i) {
|
||||
if (SWITCH_WARNING_ALLOWED(i)) {
|
||||
++count;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
#endif
|
||||
|
||||
void menuModelSetup(uint8_t event)
|
||||
{
|
||||
horzpos_t l_posHorz = m_posHorz;
|
||||
@@ -196,10 +209,10 @@ void menuModelSetup(uint8_t event)
|
||||
#define TIMERS_ROWS TIMER_ROWS, TIMER_ROWS, TIMER_ROWS
|
||||
#endif
|
||||
#if defined(REV9E)
|
||||
#define SW_WARN_ITEMS() uint8_t(NAVIGATION_LINE_BY_LINE|(getSwitchWarningsAllowed()-1)), uint8_t(getSwitchWarningsAllowed() > 8 ? TITLE_ROW : HIDDEN_ROW), uint8_t(getSwitchWarningsAllowed() > 16 ? TITLE_ROW : HIDDEN_ROW)
|
||||
#define SW_WARN_ITEMS() uint8_t(NAVIGATION_LINE_BY_LINE|(getSwitchWarningsCount()-1)), uint8_t(getSwitchWarningsCount() > 8 ? TITLE_ROW : HIDDEN_ROW), uint8_t(getSwitchWarningsCount() > 16 ? TITLE_ROW : HIDDEN_ROW)
|
||||
#define POT_WARN_ITEMS() uint8_t(g_model.potsWarnMode ? NAVIGATION_LINE_BY_LINE|NUM_POTS : 0), uint8_t(g_model.potsWarnMode ? TITLE_ROW : HIDDEN_ROW)
|
||||
#else
|
||||
#define SW_WARN_ITEMS() uint8_t(NAVIGATION_LINE_BY_LINE|getSwitchWarningsAllowed())
|
||||
#define SW_WARN_ITEMS() uint8_t(NAVIGATION_LINE_BY_LINE|getSwitchWarningsCount())
|
||||
#define POT_WARN_ITEMS() uint8_t(g_model.potsWarnMode ? NAVIGATION_LINE_BY_LINE|NUM_POTS : 0)
|
||||
#endif
|
||||
bool CURSOR_ON_CELL = (m_posHorz >= 0);
|
||||
@@ -396,7 +409,7 @@ void menuModelSetup(uint8_t event)
|
||||
case ITEM_MODEL_SWITCHES_WARNING:
|
||||
{
|
||||
#if defined(REV9E)
|
||||
if (i>=NUM_BODY_LINES-2 && getSwitchWarningsAllowed() > 8*(NUM_BODY_LINES-i)) {
|
||||
if (i>=NUM_BODY_LINES-2 && getSwitchWarningsCount() > 8*(NUM_BODY_LINES-i)) {
|
||||
if (CURSOR_MOVED_LEFT(event))
|
||||
s_pgOfs--;
|
||||
else
|
||||
|
||||
@@ -464,6 +464,17 @@ bool isMenuAvailable(int index)
|
||||
#define TOGGLE_MAIN_MENU()
|
||||
#endif
|
||||
|
||||
int getSwitchCount()
|
||||
{
|
||||
int count = 0;
|
||||
for (int i=0; i<NUM_SWITCHES; ++i) {
|
||||
if (SWITCH_EXISTS(i)) {
|
||||
++count;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
void menuMainView(uint8_t event)
|
||||
{
|
||||
DECLARE_MAIN_MENU();
|
||||
@@ -561,17 +572,30 @@ void menuMainView(uint8_t event)
|
||||
|
||||
// Switches
|
||||
#if defined(REV9E)
|
||||
for (int i=0; i<18; ++i) {
|
||||
div_t qr = div(i, 9);
|
||||
if (g_eeGeneral.view == VIEW_INPUTS) {
|
||||
div_t qr2 = div(qr.rem, 5);
|
||||
if (i >= 14) qr2.rem += 1;
|
||||
const coord_t x[4] = { 50, 144 };
|
||||
const coord_t y[4] = { 25, 42, 25, 42 };
|
||||
displaySwitch(x[qr.quot]+qr2.rem*4, y[qr2.quot], 3, i);
|
||||
if (getSwitchCount() > 8) {
|
||||
for (int i=0; i<NUM_SWITCHES; ++i) {
|
||||
div_t qr = div(i, 9);
|
||||
if (g_eeGeneral.view == VIEW_INPUTS) {
|
||||
div_t qr2 = div(qr.rem, 5);
|
||||
if (i >= 14) qr2.rem += 1;
|
||||
const coord_t x[4] = { 50, 144 };
|
||||
const coord_t y[4] = { 25, 42, 25, 42 };
|
||||
displaySwitch(x[qr.quot]+qr2.rem*4, y[qr2.quot], 3, i);
|
||||
}
|
||||
else {
|
||||
displaySwitch(15+qr.rem*6, 25+qr.quot*17, 5, i);
|
||||
}
|
||||
}
|
||||
else {
|
||||
displaySwitch(15+qr.rem*6, 25+qr.quot*17, 5, i);
|
||||
}
|
||||
else {
|
||||
int index = 0;
|
||||
for (int i=0; i<NUM_SWITCHES; ++i) {
|
||||
if (SWITCH_EXISTS(i)) {
|
||||
getvalue_t val = getValue(MIXSRC_SA+i);
|
||||
getvalue_t sw = ((val < 0) ? 3*i+1 : ((val == 0) ? 3*i+2 : 3*i+3));
|
||||
putsSwitches((g_eeGeneral.view == VIEW_INPUTS) ? (index<4 ? 8*FW+3 : 24*FW+1) : (index<4 ? 3*FW+2 : 8*FW-1), (index%4)*FH+3*FH, sw, 0);
|
||||
index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
||||
+16
-52
@@ -353,7 +353,8 @@ enum uartModes {
|
||||
#define HAS_WIRELESS_TRAINER_HARDWARE() (g_eeGeneral.uart3Mode==UART_MODE_SBUS_TRAINER/* || g_eeGeneral.uart3Mode==UART_MODE_CPPM_TRAINER*/)
|
||||
#define EXTRA_GENERAL_FIELDS \
|
||||
EXTRA_GENERAL_FIELDS_ARM \
|
||||
uint8_t uart3Mode; \
|
||||
uint8_t uart3Mode:6; \
|
||||
uint8_t slidersConfig:2; \
|
||||
uint8_t potsConfig; /*two bits for every pot*/\
|
||||
uint8_t backlightColor;
|
||||
#elif defined(CPUARM)
|
||||
@@ -408,11 +409,13 @@ PACK(typedef struct {
|
||||
#define MODELDATA_BITMAP char bitmap[LEN_BITMAP_NAME];
|
||||
#define MODELDATA_EXTRA uint8_t externalModule:3; uint8_t trainerMode:3; uint8_t potsWarnMode:2; ModuleData moduleData[NUM_MODULES+1]; char curveNames[MAX_CURVES][6]; ScriptData scriptsData[MAX_SCRIPTS]; char inputNames[MAX_INPUTS][LEN_INPUT_NAME]; uint8_t potsWarnEnabled; int8_t potsWarnPosition[NUM_POTS];
|
||||
#if defined(REV9E)
|
||||
#define swconfig_t uint64_t
|
||||
#define swarnstate_t uint64_t
|
||||
#define swarnenable_t uint32_t
|
||||
#else
|
||||
#define swarnstate_t uint32_t
|
||||
#define swarnenable_t uint16_t
|
||||
#define swconfig_t uint16_t
|
||||
#define swarnstate_t uint16_t
|
||||
#define swarnenable_t uint8_t
|
||||
#endif
|
||||
#elif defined(PCBSKY9X)
|
||||
enum ModuleIndex {
|
||||
@@ -672,38 +675,8 @@ PACK(typedef struct {
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
int switchConfig(int idx);
|
||||
#define IS_3POS(x) (switchConfig(x) == SWITCH_3POS)
|
||||
#define IS_TOGGLE(x) (switchConfig(x) == SWITCH_TOGGLE)
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS) && defined(REV9E)
|
||||
PACK(union SwitchConfig3bits {
|
||||
SwitchConfig3bits(uint8_t val):
|
||||
word(val)
|
||||
{
|
||||
}
|
||||
struct {
|
||||
int8_t val:3;
|
||||
int8_t spare:5;
|
||||
};
|
||||
uint8_t word;
|
||||
});
|
||||
enum SwitchConfig {
|
||||
SWITCH_NONE = -1,
|
||||
SWITCH_DEFAULT,
|
||||
SWITCH_TOGGLE,
|
||||
SWITCH_2POS,
|
||||
SWITCH_3POS,
|
||||
};
|
||||
#define GENERAL_FIELD_SWITCH_CONFIG uint64_t switchConfig;
|
||||
#define SWITCH_CONFIG(x) SwitchConfig3bits((g_eeGeneral.switchConfig >> (3*(x))) & 0x07).val
|
||||
#define SWITCH_DEFAULT_CONFIG(x) (SWITCH_3POS)
|
||||
#define SWITCH_EXISTS(x) (switchConfig(x) != SWITCH_NONE)
|
||||
#define SWITCH_WARNING_ALLOWED(x) (SWITCH_EXISTS(x) && !IS_TOGGLE(x))
|
||||
#elif defined(PCBTARANIS)
|
||||
enum SwitchConfig {
|
||||
SWITCH_DEFAULT,
|
||||
SWITCH_NONE,
|
||||
SWITCH_TOGGLE,
|
||||
SWITCH_2POS,
|
||||
SWITCH_3POS,
|
||||
@@ -714,12 +687,16 @@ PACK(typedef struct {
|
||||
POT_MULTIPOS_SWITCH,
|
||||
POT_WITHOUT_DETENT
|
||||
};
|
||||
#define GENERAL_FIELD_SWITCH_CONFIG uint16_t switchConfig;
|
||||
enum SliderConfig {
|
||||
SLIDER_NONE,
|
||||
SLIDER_WITH_DETENT,
|
||||
};
|
||||
#define GENERAL_FIELD_SWITCH_CONFIG swconfig_t switchConfig;
|
||||
#define SWITCH_CONFIG(x) ((g_eeGeneral.switchConfig >> (2*(x))) & 0x03)
|
||||
#define SWITCH_DEFAULT_CONFIG(x) ((x)==5 ? SWITCH_2POS : ((x)==7 ? SWITCH_TOGGLE : SWITCH_3POS))
|
||||
#define SWITCH_EXISTS(x) (true)
|
||||
#define SWITCH_WARNING_ALLOWED(x) (!IS_TOGGLE(x))
|
||||
#define POT_CONFIG(x) ((g_eeGeneral.potsConfig >> (2*(x))) & 0x03)
|
||||
#define SWITCH_EXISTS(x) (SWITCH_CONFIG(x) != SWITCH_NONE)
|
||||
#define IS_3POS(x) (SWITCH_CONFIG(x) == SWITCH_3POS)
|
||||
#define IS_TOGGLE(x) (SWITCH_CONFIG(x) == SWITCH_TOGGLE)
|
||||
#define SWITCH_WARNING_ALLOWED(x) (SWITCH_EXISTS(x) && !IS_TOGGLE(x))
|
||||
#else
|
||||
#define GENERAL_FIELD_SWITCH_CONFIG
|
||||
#endif
|
||||
@@ -789,19 +766,6 @@ PACK(typedef struct {
|
||||
#define SWITCHES_DELAY_NONE (-15)
|
||||
#define HAPTIC_STRENGTH() (3+g_eeGeneral.hapticStrength)
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
inline int getSwitchWarningsAllowed()
|
||||
{
|
||||
int count = 0;
|
||||
for (int i=0; i<NUM_SWITCHES; ++i) {
|
||||
if (SWITCH_WARNING_ALLOWED(i)) {
|
||||
++count;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
enum CurveRefType {
|
||||
CURVE_REF_DIFF,
|
||||
|
||||
@@ -262,6 +262,11 @@ void generalDefault()
|
||||
g_eeGeneral.variant = EEPROM_VARIANT;
|
||||
g_eeGeneral.contrast = 25;
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
g_eeGeneral.potsConfig = 0x05; // S1 and S2 = pots with detent
|
||||
g_eeGeneral.switchConfig = 0x00007bff; // 6x3POS, 1x2POS, 1xTOGGLE
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
g_eeGeneral.vBatWarn = 65;
|
||||
g_eeGeneral.vBatMin = -30;
|
||||
|
||||
+8
-16
@@ -353,26 +353,18 @@ extern void boardInit();
|
||||
#define memclear(p, s) memset(p, 0, s)
|
||||
#endif
|
||||
|
||||
enum PotType {
|
||||
POT_TYPE_NONE,
|
||||
POT_TYPE_DETENT,
|
||||
POT_TYPE_MULTIPOS,
|
||||
POT_TYPE_NO_DETENT,
|
||||
POT_TYPE_MAX=POT_TYPE_NO_DETENT
|
||||
};
|
||||
|
||||
#if defined(PCBTARANIS) && defined(REV9E)
|
||||
#define IS_POT_AVAILABLE(x) ((x)<POT1 || (x)>POT_LAST || ((g_eeGeneral.potsConfig & (0x03 << (2*((x)-POT1))))!=POT_TYPE_NONE))
|
||||
#define IS_POT_MULTIPOS(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_TYPE_MULTIPOS)
|
||||
#define IS_POT_WITHOUT_DETENT(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_TYPE_NO_DETENT)
|
||||
#define IS_POT_AVAILABLE(x) ((x)<POT1 || (x)>POT_LAST || ((g_eeGeneral.potsConfig & (0x03 << (2*((x)-POT1))))!=POT_NONE))
|
||||
#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) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_WITHOUT_DETENT)
|
||||
#elif defined(PCBTARANIS) && defined(REVPLUS)
|
||||
#define IS_POT_AVAILABLE(x) ((x)!=POT3 || (g_eeGeneral.potsConfig & (0x03 << (2*((x)-POT1))))!=POT_TYPE_NONE)
|
||||
#define IS_POT_MULTIPOS(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_TYPE_MULTIPOS)
|
||||
#define IS_POT_WITHOUT_DETENT(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_TYPE_NO_DETENT)
|
||||
#define IS_POT_AVAILABLE(x) ((x)!=POT3 || (g_eeGeneral.potsConfig & (0x03 << (2*((x)-POT1))))!=POT_NONE)
|
||||
#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) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_WITHOUT_DETENT)
|
||||
#elif defined(PCBTARANIS)
|
||||
#define IS_POT_AVAILABLE(x) ((x)!=POT3)
|
||||
#define IS_POT_MULTIPOS(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_TYPE_MULTIPOS)
|
||||
#define IS_POT_WITHOUT_DETENT(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_TYPE_NO_DETENT)
|
||||
#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) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_WITHOUT_DETENT)
|
||||
#else
|
||||
#define IS_POT_AVAILABLE(x) (true)
|
||||
#define IS_POT_MULTIPOS(x) (false)
|
||||
|
||||
@@ -77,14 +77,6 @@ uint64_t switchesPos = 0;
|
||||
tmr10ms_t potsLastposStart[NUM_XPOTS] = { 0 };
|
||||
uint8_t potsPos[NUM_XPOTS];
|
||||
|
||||
int switchConfig(int idx)
|
||||
{
|
||||
uint32_t config = SWITCH_CONFIG(idx);
|
||||
if (config == SWITCH_DEFAULT)
|
||||
config = SWITCH_DEFAULT_CONFIG(idx);
|
||||
return config;
|
||||
}
|
||||
|
||||
#if defined(REV9E)
|
||||
div_t switchInfo(int switchPosition)
|
||||
{
|
||||
|
||||
@@ -59,6 +59,7 @@ const pm_char STR_OPEN9X[] PROGMEM =
|
||||
ISTR(UART3MODES)
|
||||
ISTR(SWTYPES)
|
||||
ISTR(POTTYPES)
|
||||
ISTR(SLIDERTYPES)
|
||||
#endif
|
||||
ISTR(VTRIMINC)
|
||||
#if defined(CPUARM)
|
||||
|
||||
@@ -106,7 +106,8 @@ extern const pm_char STR_OPEN9X[];
|
||||
#define OFS_UART3MODES (OFS_TRNCHN + sizeof(TR_TRNCHN))
|
||||
#define OFS_SWTYPES (OFS_UART3MODES + sizeof(TR_UART3MODES))
|
||||
#define OFS_POTTYPES (OFS_SWTYPES + sizeof(TR_SWTYPES))
|
||||
#define OFS_VTRIMINC (OFS_POTTYPES + sizeof(TR_POTTYPES))
|
||||
#define OFS_SLIDERTYPES (OFS_POTTYPES + sizeof(TR_POTTYPES))
|
||||
#define OFS_VTRIMINC (OFS_SLIDERTYPES + sizeof(TR_SLIDERTYPES))
|
||||
#else
|
||||
#define OFS_VTRIMINC (OFS_TRNCHN + sizeof(TR_TRNCHN))
|
||||
#endif
|
||||
@@ -215,6 +216,7 @@ extern const pm_char STR_OPEN9X[];
|
||||
#define STR_UART3MODES (STR_OPEN9X + OFS_UART3MODES)
|
||||
#define STR_SWTYPES (STR_OPEN9X + OFS_SWTYPES)
|
||||
#define STR_POTTYPES (STR_OPEN9X + OFS_POTTYPES)
|
||||
#define STR_SLIDERTYPES (STR_OPEN9X + OFS_SLIDERTYPES)
|
||||
#define STR_VTRIMINC (STR_OPEN9X + OFS_VTRIMINC)
|
||||
#define STR_VDISPLAYTRIMS (STR_OPEN9X + OFS_VDISPLAYTRIMS)
|
||||
#define STR_RETA123 (STR_OPEN9X + OFS_RETA123)
|
||||
|
||||
@@ -82,16 +82,15 @@
|
||||
#define LEN_UART3MODES "\015"
|
||||
#define TR_UART3MODES "OFF\0 ""S-Port Mirror""Telemetry\0 ""SBUS Trainer\0""Debug\0"
|
||||
|
||||
#define LEN_SWTYPES "\007"
|
||||
#if defined(REV9E)
|
||||
#define TR_SWTYPES "None\0 ""Default""Toggle\0""2POS\0 ""3POS\0"
|
||||
#else
|
||||
#define TR_SWTYPES "Default""Toggle\0""2POS\0 ""3POS\0"
|
||||
#endif
|
||||
#define LEN_SWTYPES "\006"
|
||||
#define TR_SWTYPES "None\0 ""Toggle""2POS\0 ""3POS\0"
|
||||
|
||||
#define LEN_POTTYPES "\017"
|
||||
#define TR_POTTYPES "None\0 ""Pot with detent""Multipos Switch""Pot\0"
|
||||
|
||||
#define LEN_SLIDERTYPES "\006"
|
||||
#define TR_SLIDERTYPES "None\0 ""Slider"
|
||||
|
||||
#define LEN_DATETIME "\005"
|
||||
#define TR_DATETIME "DATE:""TIME:"
|
||||
|
||||
|
||||
@@ -92,6 +92,9 @@
|
||||
#define LEN_POTTYPES "\017"
|
||||
#define TR_POTTYPES "Rien\0 ""Pot avec centre""Inter multi-pos""Potentiomètre\0"
|
||||
|
||||
#define LEN_SLIDERTYPES "\006"
|
||||
#define TR_SLIDERTYPES "Rien\0 ""Slider"
|
||||
|
||||
#define LEN_DATETIME "\005"
|
||||
#define TR_DATETIME "DATE:""HEURE"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user