X9LiteS (#6820)
This commit is contained in:
@@ -297,6 +297,36 @@ void onMainViewMenu(const char *result)
|
||||
}
|
||||
}
|
||||
|
||||
void drawSmallSwitch(coord_t x, coord_t y, int width, unsigned int index)
|
||||
{
|
||||
if (SWITCH_EXISTS(index)) {
|
||||
int val = getValue(MIXSRC_FIRST_SWITCH+index);
|
||||
|
||||
if (val >= 0) {
|
||||
lcdDrawSolidHorizontalLine(x, y, width);
|
||||
lcdDrawSolidHorizontalLine(x, y+2, width);
|
||||
y += 4;
|
||||
if (val > 0) {
|
||||
lcdDrawSolidHorizontalLine(x, y, width);
|
||||
lcdDrawSolidHorizontalLine(x, y+2, width);
|
||||
y += 4;
|
||||
}
|
||||
}
|
||||
|
||||
lcdDrawChar(width==5 ? x+1 : x, y, 'A'+index, SMLSIZE);
|
||||
y += 7;
|
||||
|
||||
if (val <= 0) {
|
||||
lcdDrawSolidHorizontalLine(x, y, width);
|
||||
lcdDrawSolidHorizontalLine(x, y+2, width);
|
||||
if (val < 0) {
|
||||
lcdDrawSolidHorizontalLine(x, y+4, width);
|
||||
lcdDrawSolidHorizontalLine(x, y+6, width);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void menuMainView(event_t event)
|
||||
{
|
||||
uint8_t view = g_eeGeneral.view;
|
||||
@@ -472,7 +502,19 @@ void menuMainView(event_t event)
|
||||
doMainScreenGraphics();
|
||||
|
||||
// Switches
|
||||
#if defined(PCBX9LITE)
|
||||
#if defined(PCBX9LITES)
|
||||
static const uint8_t x[NUM_SWITCHES-2] = {2*FW-2, 2*FW-2, 17*FW+1, 2*FW-2, 17*FW+1};
|
||||
static const uint8_t y[NUM_SWITCHES-2] = {4*FH+1, 5*FH+1, 5*FH+1, 6*FH+1, 6*FH+1};
|
||||
for (int i=0; i<NUM_SWITCHES - 2; ++i) {
|
||||
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(x[i], y[i], sw, 0);
|
||||
}
|
||||
}
|
||||
drawSmallSwitch(29, 5*FH+1, 4, SW_SF);
|
||||
drawSmallSwitch(16*FW+1, 5*FH+1, 4, SW_SG);
|
||||
#elif defined(PCBX9LITE)
|
||||
static const uint8_t x[NUM_SWITCHES] = {2*FW-2, 2*FW-2, 16*FW+1, 2*FW-2, 16*FW+1};
|
||||
static const uint8_t y[NUM_SWITCHES] = {4*FH+1, 5*FH+1, 5*FH+1, 6*FH+1, 6*FH+1};
|
||||
for (int i=0; i<NUM_SWITCHES; ++i) {
|
||||
|
||||
Reference in New Issue
Block a user