New type swsrc_t introduced

This commit is contained in:
Bertrand Songis
2015-08-28 14:47:07 +02:00
parent 3920cc6919
commit ef56bf3cb4
8 changed files with 16 additions and 14 deletions
+2 -2
View File
@@ -727,7 +727,7 @@ void putsModelName(coord_t x, coord_t y, char *name, uint8_t id, LcdFlags att)
}
}
void putsSwitches(coord_t x, coord_t y, int8_t idx, LcdFlags att)
void putsSwitches(coord_t x, coord_t y, swsrc_t idx, LcdFlags att)
{
if (idx == SWSRC_OFF)
return lcd_putsiAtt(x, y, STR_OFFON, 0, att);
@@ -803,7 +803,7 @@ void putsCurve(coord_t x, coord_t y, int8_t idx, LcdFlags att)
putsStrIdx(x, y, STR_CV, idx, att);
}
void putsTimerMode(coord_t x, coord_t y, int8_t mode, LcdFlags att)
void putsTimerMode(coord_t x, coord_t y, swsrc_t mode, LcdFlags att)
{
if (mode >= 0) {
if (mode < TMRMODE_COUNT)
+2 -2
View File
@@ -167,7 +167,7 @@ void lcd_outdez8(coord_t x, coord_t y, int8_t val);
void putsStrIdx(coord_t x, coord_t y, const pm_char *str, uint8_t idx, LcdFlags att=0);
void putsModelName(coord_t x, coord_t y, char *name, uint8_t id, LcdFlags att);
void putsSwitches(coord_t x, coord_t y, int8_t swtch, LcdFlags att=0);
void putsSwitches(coord_t x, coord_t y, swsrc_t swtch, LcdFlags att=0);
void putsStickName(coord_t x, coord_t y, uint8_t idx, LcdFlags att=0);
void putsMixerSource(coord_t x, coord_t y, uint32_t idx, LcdFlags att=0);
void putsFlightMode(coord_t x, coord_t y, int8_t idx, LcdFlags att=0);
@@ -175,7 +175,7 @@ void putsFlightMode(coord_t x, coord_t y, int8_t idx, LcdFlags att=0);
void putsCurveRef(coord_t x, coord_t y, CurveRef &curve, LcdFlags att);
#endif
void putsCurve(coord_t x, coord_t y, int8_t idx, LcdFlags att=0);
void putsTimerMode(coord_t x, coord_t y, int8_t mode, LcdFlags att=0);
void putsTimerMode(coord_t x, coord_t y, swsrc_t mode, LcdFlags att=0);
void putsTrimMode(coord_t x, coord_t y, uint8_t phase, uint8_t idx, LcdFlags att);
#define putsChn(x, y, idx, att) putsMixerSource(x, y, MIXSRC_CH1+idx-1, att)
+3 -3
View File
@@ -142,15 +142,15 @@ void editTimerMode(int timerIdx, coord_t y, LcdFlags attr, uint8_t event)
switch (m_posHorz) {
case 0:
{
int8_t timerMode = timer->mode;
swsrc_t timerMode = timer->mode;
if (timerMode < 0) timerMode -= TMRMODE_COUNT-1;
CHECK_INCDEC_MODELVAR_CHECK(event, timerMode, -TMRMODE_COUNT-SWSRC_LAST+1, TMRMODE_COUNT+SWSRC_LAST-1, isSwitchAvailableInTimers);
if (timerMode < 0) timerMode += TMRMODE_COUNT-1;
timer->mode = timerMode;
#if defined(AUTOSWITCH)
if (s_editMode>0) {
int8_t val = timer->mode - (TMRMODE_COUNT-1);
int8_t switchVal = checkIncDecMovedSwitch(val);
swsrc_t val = timer->mode - (TMRMODE_COUNT-1);
swsrc_t switchVal = checkIncDecMovedSwitch(val);
if (val != switchVal) {
timer->mode = switchVal + (TMRMODE_COUNT-1);
eeDirty(EE_MODEL);
+1 -1
View File
@@ -176,7 +176,7 @@ extern const CheckIncDecStops &stopsSwitch;
(val), (val+1)
int checkIncDec(unsigned int event, int val, int i_min, int i_max, unsigned int i_flags=0, IsValueAvailable isValueAvailable=NULL, const CheckIncDecStops &stops=stops100);
int8_t checkIncDecMovedSwitch(int8_t val);
swsrc_t checkIncDecMovedSwitch(swsrc_t val);
#define checkIncDecModel(event, i_val, i_min, i_max) checkIncDec(event, i_val, i_min, i_max, EE_MODEL)
#define checkIncDecModelZero(event, i_val, i_max) checkIncDec(event, i_val, 0, i_max, EE_MODEL)
#define checkIncDecGen(event, i_val, i_min, i_max) checkIncDec(event, i_val, i_min, i_max, EE_GENERAL)
+2 -2
View File
@@ -45,10 +45,10 @@ uint8_t calibrationState;
int checkIncDecSelection = 0;
#if defined(AUTOSWITCH)
int8_t checkIncDecMovedSwitch(int8_t val)
swsrc_t checkIncDecMovedSwitch(swsrc_t val)
{
if (s_editMode>0) {
int8_t swtch = getMovedSwitch();
swsrc_t swtch = getMovedSwitch();
if (swtch) {
div_t info = switchInfo(swtch);
if (IS_TOGGLE(info.quot)) {