Reorganize ana display for X7 (#5482)

This commit is contained in:
3djc
2017-12-08 11:27:37 +01:00
committed by Bertrand Songis
parent a6044a684d
commit 12ad7b0d9c
+22 -5
View File
@@ -2,7 +2,7 @@
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
@@ -51,16 +51,23 @@ void menuRadioDiagKeys(event_t event)
if (i < 6) {
y = MENU_HEADER_HEIGHT + FH + FH*i;
#if defined(PCBX7)
if (i > 1) {
lcdDrawTextAtIndex(0, y, STR_VKEYS, (5-i), 0);
displayKeyState(5*FW+4, y, KEY_MENU+(5-i));
}
#else
lcdDrawTextAtIndex(0, y, STR_VKEYS, (5-i), 0);
displayKeyState(5*FW+2, y, KEY_MENU+(5-i));
#endif
}
#if defined(PCBTARANIS)
if (i < NUM_SWITCHES) {
if (SWITCH_EXISTS(i)) {
getvalue_t val = getValue(MIXSRC_FIRST_SWITCH+i);
getvalue_t sw = ((val < 0) ? 3*i+1 : ((val == 0) ? 3*i+2 : 3*i+3));
drawSwitch(8*FW, y, sw, 0);
drawSwitch(8*FW+4, y, sw, 0);
}
}
#else
@@ -74,12 +81,22 @@ void menuRadioDiagKeys(event_t event)
#if defined(ROTARY_ENCODER_NAVIGATION)
for (uint8_t i=0; i<DIM(rotencValue); i++) {
#if defined(PCBX7)
coord_t y = MENU_HEADER_HEIGHT + FH;
coord_t x = 6*FW+3;
lcdDrawTextAtIndex(0, MENU_HEADER_HEIGHT + FH , STR_VRENCODERS, i, 0);
#else
coord_t y = MENU_HEADER_HEIGHT /* ??? + 1 ??? */ + i*FH;
coord_t x = 19*FW;
lcdDrawTextAtIndex(14*FW, y, STR_VRENCODERS, i, 0);
#endif
#if defined(ROTARY_ENCODERS)
lcdDrawNumber(18*FW, y, rotencValue[i], LEFT|(keyState(BTN_REa+i) ? INVERS : 0));
lcdDrawNumber(x, y, rotencValue[i], LEFT|(keyState(BTN_REa+i) ? INVERS : 0));
#elif defined(PCBX7)
lcdDrawNumber(x, y, rotencValue[i], RIGHT);
#else
lcdDrawNumber(18*FW, y, rotencValue[i], LEFT);
lcdDrawNumber(x, y, rotencValue[i], LEFT);
#endif
}
#endif