Introduce T-pro and function switches handling

This commit is contained in:
3djc
2021-12-17 17:07:48 +01:00
committed by Raphael Coeffic
parent 69dafd13c0
commit d31482c18b
63 changed files with 1324 additions and 70 deletions
+22 -3
View File
@@ -41,7 +41,7 @@ void menuRadioDiagKeys(event_t event)
lcdDrawText(14*FW, MENU_HEADER_HEIGHT + 1, STR_VTRIM);
for (uint8_t i=0; i<9; i++) {
for (uint8_t i=0; i<10; i++) {
coord_t y;
if (i < NUM_TRIMS_KEYS) {
@@ -69,10 +69,19 @@ void menuRadioDiagKeys(event_t event)
drawSwitch(8*FW, y, i+1, 0);
displaySwitchState(11*FW+2, y, i);
}
#elif (NUM_SWITCHES > 6)
if (i < NUM_SWITCHES) {
if (SWITCH_EXISTS(i)) {
y = (i > 4) ? FH*(i-4) : MENU_HEADER_HEIGHT + FH*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(i > 4 ? 11*FW-5: 8*FW-9, y, sw, 0, false);
}
}
#else
if (i < NUM_SWITCHES) {
if (SWITCH_EXISTS(i)) {
y = (NUM_SWITCHES > 6 ? 0 : MENU_HEADER_HEIGHT) + FH*i;
y = (NUM_SWITCHES - NUM_FUNCTIONS_SWITCHES > 6 ? 0 : MENU_HEADER_HEIGHT) + FH*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+4, y, sw, 0);
@@ -81,8 +90,18 @@ void menuRadioDiagKeys(event_t event)
#endif
}
#if defined(FUNCTION_SWITCHES) && defined(DEBUG)
lcdDrawText(LCD_W / 2 , LCD_H - 2 * FH, "Phys");
lcdDrawText(LCD_W / 2 , LCD_H - 1 * FH, "Log");
for (uint8_t i = 0; i < NUM_FUNCTIONS_SWITCHES; i++) {
lcdDrawNumber(LCD_W / 2 + 20 + (i + 1) * FW , LCD_H - 2 * FH, getFSPhysicalState(i));
lcdDrawNumber(LCD_W / 2 + 20 + (i + 1) * FW , LCD_H - 1 * FH, getFSLogicalState(i));
}
#endif
#if defined(ROTARY_ENCODER_NAVIGATION)
coord_t y = MENU_HEADER_HEIGHT + 1 + FH*KEY_COUNT;
coord_t y = LCD_H - FH - 1;
lcdDrawText(0, y, STR_ROTARY_ENCODER);
lcdDrawNumber(5*FW+FWNUM+2, y, rotencValue / ROTARY_ENCODER_GRANULARITY, RIGHT);
#endif