#1549 (Firmware part)

This commit is contained in:
bsongis
2014-07-23 17:05:14 +02:00
parent fd84c62ff4
commit 7a85328b86
12 changed files with 24 additions and 19 deletions
+9 -6
View File
@@ -348,17 +348,20 @@ extern void boardInit();
enum PotType {
POT_TYPE_NONE,
POT_TYPE_POT,
POT_TYPE_DETENT,
POT_TYPE_MULTIPOS,
POT_TYPE_MAX=POT_TYPE_MULTIPOS
POT_TYPE_NO_DETENT,
POT_TYPE_MAX=POT_TYPE_NO_DETENT
};
#if defined(PCBTARANIS)
#define IS_POT_AVAILABLE(x) ((x)!=POT3 || (g_eeGeneral.potsType & (0x03 << (2*((x)-POT1))))!=POT_TYPE_NONE)
#define IS_POT_MULTIPOS(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsType>>(2*((x)-POT1)))&0x03)==POT_TYPE_MULTIPOS)
#define IS_POT_AVAILABLE(x) ((x)!=POT3 || (g_eeGeneral.potsType & (0x03 << (2*((x)-POT1))))!=POT_TYPE_NONE)
#define IS_POT_MULTIPOS(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsType>>(2*((x)-POT1)))&0x03)==POT_TYPE_MULTIPOS)
#define IS_POT_WITHOUT_DETENT(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsType>>(2*((x)-POT1)))&0x03)==POT_TYPE_NO_DETENT)
#else
#define IS_POT_AVAILABLE(x) (true)
#define IS_POT_MULTIPOS(x) (false)
#define IS_POT_AVAILABLE(x) (true)
#define IS_POT_MULTIPOS(x) (false)
#define IS_POT_WITHOUT_DETENT(x) (true)
#endif
#define GET_LOWRES_POT_POSITION(i) (getValue(MIXSRC_FIRST_POT+(i)) >> 4)