[all] Change in Mixer sources order (will allow the EXTRA_3POS option later)

[all] Change in Switches order (to match the Mixer sources order and save some flash)
[all] New menu in MODELSEL when a ROTARY_ENCODER_NAVIGATION enabled
[all] Add REs (short) and REl (long) in Custom Functions screen. Will be needed later to reset the Rotary Encoder (for example)
This commit is contained in:
bsongis
2013-02-18 18:52:11 +00:00
parent 9d8bfea60a
commit 9fb1eb665f
18 changed files with 1033 additions and 881 deletions
+45 -39
View File
@@ -561,7 +561,7 @@ void lcd_hline(xcoord_t x, uint8_t y, xcoord_t w, LcdFlags att)
lcd_hlineStip(x, y, w, 0xff, att);
}
#if defined(PCBSTD)
#if defined(CPUM64)
void lcd_vlineStip(xcoord_t x, int8_t y, int8_t h, uint8_t pat)
{
if (x >= LCD_W) return;
@@ -752,37 +752,25 @@ void putsStrIdx(xcoord_t x, uint8_t y, const pm_char *str, uint8_t idx, LcdFlags
lcd_putsAtt(x, y, str, att);
}
void putsChnRaw(xcoord_t x, uint8_t y, uint8_t idx, LcdFlags att)
{
if (idx==0)
lcd_putsiAtt(x, y, STR_MMMINV, 0, att);
else if (idx<=NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS+NUM_STICKS+1+NUM_SW_SRCRAW+NUM_CYC)
lcd_putsiAtt(x, y, STR_VSRCRAW, idx-1, att);
else if (idx<=NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS+NUM_STICKS+1+NUM_SW_SRCRAW+NUM_CYC+NUM_PPM)
putsStrIdx(x, y, STR_PPM, idx - (NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS+NUM_STICKS+1+NUM_SW_SRCRAW+NUM_CYC), att);
else if (idx<=NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS+NUM_STICKS+1+NUM_SW_SRCRAW+NUM_CYC+NUM_PPM+NUM_CHNOUT)
putsStrIdx(x, y, STR_CH, idx - (NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS+NUM_STICKS+1+NUM_SW_SRCRAW+NUM_CYC+NUM_PPM), att);
else
lcd_putsiAtt(x, y, STR_VTELEMCHNS, idx-(NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS+NUM_STICKS+1+NUM_SW_SRCRAW+NUM_CYC+NUM_PPM+NUM_CHNOUT), att);
}
void putsMixerSource(xcoord_t x, uint8_t y, uint8_t idx, LcdFlags att)
{
#if defined(PCBX9D) || defined(PCBACT)
if (idx<=NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS+NUM_STICKS+1+NUM_SW_SRCRAW)
putsChnRaw(x, y, idx, att);
else if (idx<=NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS+NUM_STICKS+1+NUM_SW_SRCRAW+NUM_CSW)
putsSwitches(x, y, MAX_PSWITCH + idx-(NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS+NUM_STICKS+1+NUM_SW_SRCRAW), att);
else
putsChnRaw(x, y, idx-NUM_CSW, att);
#if defined(PCBX9D)
if (idx < MIXSRC_SW1)
lcd_putsiAtt(x, y, STR_VSRCRAW, idx, att);
else if (idx < MIXSRC_PPM1)
putsSwitches(x, y, idx-MIXSRC_SA, att);
#else
if (idx<=NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS+NUM_STICKS+1+NUM_SW_SRCRAW)
putsChnRaw(x, y, idx, att);
else if (idx<=NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS+NUM_STICKS+1+NUM_SW_SRCRAW+MAX_SWITCH)
putsSwitches(x, y, idx-(NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS+NUM_STICKS+1+NUM_SW_SRCRAW), att);
else
putsChnRaw(x, y, idx-MAX_SWITCH, att);
if (idx < MIXSRC_THR)
lcd_putsiAtt(x, y, STR_VSRCRAW, idx, att);
else if (idx < MIXSRC_PPM1)
putsSwitches(x, y, idx-MIXSRC_THR+1+3*(1/*+EXTRA_3POS*/), att);
#endif
else if (idx < MIXSRC_CH1)
putsStrIdx(x, y, STR_PPM, idx-MIXSRC_PPM1+1, att);
else if (idx <= MIXSRC_LAST_CH)
putsStrIdx(x, y, STR_CH, idx-MIXSRC_CH1+1, att);
else
lcd_putsiAtt(x, y, STR_VTELEMCHNS, idx-MIXSRC_LAST_CH, att);
}
void putsChnLetter(xcoord_t x, uint8_t y, uint8_t idx, LcdFlags attr)
@@ -804,25 +792,43 @@ void putsModelName(xcoord_t x, uint8_t y, char *name, uint8_t id, LcdFlags att)
void putsSwitches(xcoord_t x, uint8_t y, int8_t idx, LcdFlags att)
{
if (idx == 0)
if (idx == SWSRC_NONE)
return lcd_putsiAtt(x, y, STR_MMMINV, 0, att);
if (att & SWONOFF) {
if (idx == SWITCH_ON)
return lcd_putsiAtt(x, y, STR_OFFON, 1, att);
if (idx == SWITCH_OFF)
return lcd_putsiAtt(x, y, STR_OFFON, 0, att);
}
if (idx == SWSRC_ON)
return lcd_putsiAtt(x, y, STR_OFFON, 1, att);
if (idx == SWSRC_OFF)
return lcd_putsiAtt(x, y, STR_OFFON, 0, att);
if (idx < 0) {
lcd_vlineStip(x-2, y, 8, 0x5E/*'!'*/);
idx = -idx;
}
if (idx > MAX_SWITCH) {
idx -= ((att & SWONOFF) ? MAX_SWITCH+1 : MAX_SWITCH);
#if ROTARY_ENCODERS > 0
if (idx >= SWSRC_FIRST_ROTENC_SWITCH) {
if (idx <= SWSRC_LAST_ROTENC_SWITCH) {
idx -= SWSRC_FIRST_ROTENC_SWITCH;
char suffix;
if (idx < ROTARY_ENCODERS) {
suffix = 's';
}
else {
idx -= ROTARY_ENCODERS;
suffix = 'l';
}
lcd_putcAtt(x+3*FW, y, suffix, att);
return lcd_putsiAtt(x, y, STR_VRENCODERS, idx, att);
}
idx -= 2*ROTARY_ENCODERS;
}
#endif
if (idx > SWSRC_ON) {
idx -= SWSRC_ON;
char suffix = 'm';
#if defined(CPUARM)
if (idx > MAX_SWITCH+1) {
if (idx > SWSRC_ON) {
suffix = 's';
idx -= MAX_SWITCH+1;
idx -= SWSRC_ON;
if (idx > MAX_PSWITCH) {
suffix = 'l';
idx -= MAX_PSWITCH;