1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-25 01:05:10 +03:00

[Taranis] Support for the 6POS Pots

This commit is contained in:
Bertrand Songis 2013-12-31 13:02:53 +01:00
parent 64419ffd3f
commit 1c8b865d89
17 changed files with 101 additions and 48 deletions

View file

@ -232,13 +232,13 @@ int16_t checkIncDec(uint8_t event, int16_t val, int16_t i_min, int16_t i_max, ui
if (event == EVT_KEY_LONG(KEY_ENTER) && i_max > SWSRC_ON) {
s_editMode = !s_editMode;
if (newval > SWSRC_ON)
newval -= (MAX_SWITCH+1);
newval -= (NUM_SWITCH+1);
else if (newval > 0)
newval += (MAX_SWITCH+1);
newval += (NUM_SWITCH+1);
else if (newval < SWSRC_OFF)
newval += (MAX_SWITCH+1);
newval += (NUM_SWITCH+1);
else if (newval < 0)
newval -= (MAX_SWITCH+1);
newval -= (NUM_SWITCH+1);
}
}
#endif
@ -976,7 +976,7 @@ int8_t switchMenuItem(uint8_t x, uint8_t y, int8_t value, LcdFlags attr, uint8_t
{
lcd_putsColumnLeft(x, y, STR_SWITCH);
putsSwitches(x, y, value, attr);
if (attr) CHECK_INCDEC_MODELSWITCH(event, value, -MAX_SWITCH, MAX_SWITCH);
if (attr) CHECK_INCDEC_MODELSWITCH(event, value, -NUM_SWITCH, NUM_SWITCH);
return value;
}