Rotary encoder refactoring

This commit is contained in:
Bertrand Songis
2019-04-30 14:55:21 +02:00
parent 4f6828aa1c
commit c28210e3e4
60 changed files with 363 additions and 652 deletions
+6 -14
View File
@@ -86,25 +86,17 @@ void menuRadioDiagKeys(event_t event)
}
#if defined(ROTARY_ENCODER_NAVIGATION)
for (uint8_t i=0; i<DIM(rotencValue); i++) {
#if defined(PCBX7)
#if defined(PCBX7) || defined(PCBX3)
coord_t y = MENU_HEADER_HEIGHT + FH;
coord_t x = 6*FW+3;
lcdDrawTextAtIndex(0, MENU_HEADER_HEIGHT + FH , STR_VRENCODERS, i, 0);
lcdDrawTextAtIndex(0, MENU_HEADER_HEIGHT + FH , STR_VRENCODERS, 0, 0);
lcdDrawNumber(x, y, rotencValue, RIGHT);
#else
coord_t y = MENU_HEADER_HEIGHT /* ??? + 1 ??? */ + i*FH;
coord_t y = MENU_HEADER_HEIGHT;
coord_t x = 19*FW;
lcdDrawTextAtIndex(14*FW, y, STR_VRENCODERS, i, 0);
lcdDrawTextAtIndex(14*FW, y, STR_VRENCODERS, 0, 0);
lcdDrawNumber(x, y, rotencValue, LEFT);
#endif
#if defined(ROTARY_ENCODERS)
lcdDrawNumber(x, y, rotencValue[i], LEFT|(keyState(BTN_REa+i) ? INVERS : 0));
#elif defined(PCBX7)
lcdDrawNumber(x, y, rotencValue[i], RIGHT);
#else
lcdDrawNumber(x, y, rotencValue[i], LEFT);
#endif
}
#endif
}