Merge branch 'bsongis/Issue592_sticky_switches' into next

Conflicts:
	radio/src/gui/menu_model.cpp
This commit is contained in:
Andre Bernet
2014-02-07 23:39:28 +01:00
61 changed files with 2604 additions and 2383 deletions
+39 -39
View File
@@ -397,7 +397,6 @@ enum EnumKeys {
#define NUM_PSWITCH (SWSRC_LAST_SWITCH-SWSRC_FIRST_SWITCH+1)
#define NUM_POTSSW (NUM_XPOTS*6)
#define NUM_SWITCH (NUM_PSWITCH+NUM_CSW+NUM_POTSSW)
#if defined(PCBTARANIS)
#define KEY_RIGHT KEY_PLUS
@@ -623,33 +622,6 @@ enum BaseCurves {
#define SWASH_TYPE_90 4
#define SWASH_TYPE_NUM 4
enum CswFunctions {
CS_OFF,
CS_VEQUAL, // v==offset
CS_VPOS, // v>offset
CS_VNEG, // v<offset
CS_APOS, // |v|>offset
CS_ANEG, // |v|<offset
CS_AND,
CS_OR,
CS_XOR,
CS_EQUAL,
CS_GREATER,
CS_LESS,
CS_DIFFEGREATER,
CS_ADIFFEGREATER,
CS_TIMER,
CS_MAXF = CS_TIMER
};
#define CS_VOFS 0
#define CS_VBOOL 1
#define CS_VCOMP 2
#define CS_VDIFF 3
#define CS_VTIMER 4
uint8_t cswFamily(uint8_t func);
int16_t cswTimerValue(int8_t val);
#define NUM_CYC 3
#define NUM_CAL_PPM 4
#define NUM_PPM 8
@@ -802,6 +774,7 @@ enum PowerState {
};
bool switchState(EnumKeys enuk);
uint8_t trimDown(uint8_t idx);
void readKeysAndTrims();
uint16_t evalChkSum();
@@ -946,10 +919,8 @@ extern uint16_t s_timeCumThr;
extern uint16_t s_timeCum16ThrP;
struct TimerState {
uint8_t lastPos;
uint16_t cnt;
uint16_t sum;
uint8_t toggled;
uint8_t state;
int16_t val;
uint8_t val_10ms;
@@ -1318,20 +1289,49 @@ extern int24_t act [MAX_MIXERS];
#define isMixActive(x) false
#endif
enum CswFunctionFamilies {
CS_FAMILY_OFS,
CS_FAMILY_BOOL,
CS_FAMILY_COMP,
CS_FAMILY_DIFF,
CS_FAMILY_TIMER,
CS_FAMILY_STICKY,
CS_FAMILY_RANGE,
CS_FAMILY_STAY
};
uint8_t cswFamily(uint8_t func);
int16_t cswTimerValue(delayval_t val);
#if defined(CPUARM)
#define MASK_CFN_TYPE uint32_t // current max = 32 function switches
#define MASK_FUNC_TYPE uint32_t // current max = 32 functions
#define MASK_CFN_TYPE uint32_t // current max = 32 function switches
#define MASK_FUNC_TYPE uint32_t // current max = 32 functions
#elif defined(CPUM64)
#define MASK_CFN_TYPE uint16_t // current max = 16 function switches
#define MASK_FUNC_TYPE uint16_t // current max = 16 functions
#define MASK_CFN_TYPE uint16_t // current max = 16 function switches
#define MASK_FUNC_TYPE uint8_t // current max = 8 functions
#else
#define MASK_CFN_TYPE uint32_t // current max = 32 function switches
#define MASK_FUNC_TYPE uint16_t // current max = 16 functions
#define MASK_CFN_TYPE uint32_t // current max = 32 function switches
#define MASK_FUNC_TYPE uint8_t // current max = 8 functions
#endif
extern MASK_CFN_TYPE activeSwitches;
extern MASK_CFN_TYPE activeFnSwitches;
enum FunctionsActive {
FUNCTION_TRAINER,
FUNCTION_INSTANT_TRIM = FUNCTION_TRAINER+4,
FUNCTION_VARIO,
FUNCTION_BACKLIGHT,
#if defined(SDCARD)
FUNCTION_LOGS,
#endif
#if defined(CPUARM)
FUNCTION_BACKGND_MUSIC,
FUNCTION_BACKGND_MUSIC_PAUSE,
#endif
};
extern MASK_FUNC_TYPE activeFunctions;
extern MASK_CFN_TYPE activeFnSwitches;
extern tmr10ms_t lastFunctionTime[NUM_CFN];
#if defined(CPUARM)
@@ -1340,7 +1340,7 @@ extern bool evalFunctionsFirstTime;
inline bool isFunctionActive(uint8_t func)
{
return activeFunctions & ((MASK_FUNC_TYPE)1 << (func-FUNC_TRAINER));
return activeFunctions & ((uint8_t)1 << func);
}
#if defined(ROTARY_ENCODERS)