feat: More flexible ADC inputs (#3870)
Co-authored-by: 3djc <lesitewebdejc@hotmail.com> Co-authored-by: Peter Feerick <peter.feerick@gmail.com> Co-authored-by: philmoz <phil.a.mitchell@gmail.com>
This commit is contained in:
co-authored by
3djc
Peter Feerick
philmoz
parent
f5593c44e8
commit
b48e07026d
+14
-8
@@ -256,15 +256,21 @@ enum RotaryEncoderMode {
|
||||
void memswap(void * a, void * b, uint8_t size);
|
||||
|
||||
// TODO: move these config check macros somewhere else
|
||||
#define POT_CONFIG(x) \
|
||||
((g_eeGeneral.potsConfig >> POT_CONFIG_POS(x)) & POT_CFG_MASK)
|
||||
#define POT_CONFIG(x) (getPotType(x))
|
||||
|
||||
#define IS_POT_MULTIPOS(x) (POT_CONFIG(x) == POT_MULTIPOS_SWITCH)
|
||||
#define IS_POT_WITHOUT_DETENT(x) (POT_CONFIG(x) == POT_WITHOUT_DETENT)
|
||||
#define IS_SLIDER(x) (POT_CONFIG(x) == POT_SLIDER_WITH_DETENT)
|
||||
#define IS_POT_AVAILABLE(x) (POT_CONFIG(x) != POT_NONE)
|
||||
#define IS_POT_SLIDER_AVAILABLE(x) (IS_POT_AVAILABLE(x))
|
||||
#define IS_MULTIPOS_CALIBRATED(cal) (cal->count > 0 && cal->count < XPOTS_MULTIPOS_COUNT)
|
||||
#define IS_POT_MULTIPOS(x) (POT_CONFIG(x) == FLEX_MULTIPOS)
|
||||
|
||||
#define IS_POT_WITHOUT_DETENT(x) (POT_CONFIG(x) == FLEX_POT)
|
||||
|
||||
#define IS_SLIDER(x) (POT_CONFIG(x) == FLEX_SLIDER)
|
||||
|
||||
#define IS_POT_AVAILABLE(x) \
|
||||
(POT_CONFIG(x) != FLEX_NONE && POT_CONFIG(x) <= FLEX_MULTIPOS)
|
||||
|
||||
#define IS_POT_SLIDER_AVAILABLE(x) (IS_POT_AVAILABLE(x))
|
||||
|
||||
#define IS_MULTIPOS_CALIBRATED(cal) \
|
||||
(cal->count > 0 && cal->count < XPOTS_MULTIPOS_COUNT)
|
||||
|
||||
#define IS_SWITCH_MULTIPOS(x) \
|
||||
(SWSRC_FIRST_MULTIPOS_SWITCH <= (x) && (x) <= SWSRC_LAST_MULTIPOS_SWITCH)
|
||||
|
||||
Reference in New Issue
Block a user