1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-25 01:05:10 +03:00

[Taranis) Switch names displayed below bars in calibration screen

This commit is contained in:
bsongis 2015-06-12 08:16:22 +02:00
parent ed7cb82d3b
commit b0a4de5a14
8 changed files with 45 additions and 45 deletions

View file

@ -251,7 +251,7 @@ void lcdDrawTelemetryTopBar();
#define V_BAR(xx, yy, ll) \
lcd_vline(xx-1,yy-ll,ll); \
lcd_vline(xx ,yy-ll,ll); \
lcd_vline(xx+1,yy-ll,ll);
lcd_vline(xx+1,yy-ll,ll)
void lcd_img(coord_t x, coord_t y, const pm_uchar * img, uint8_t idx, LcdFlags att=0);

View file

@ -67,7 +67,7 @@ void drawPotsBars()
for (x=LCD_W/2-5, i=NUM_STICKS; i<NUM_STICKS+NUM_POTS; x+=5, i++) {
if (IS_POT_AVAILABLE(i)) {
len = ((calibratedStick[i]+RESX)*BAR_HEIGHT/(RESX*2))+1l; // calculate once per loop
V_BAR(x, LCD_H-8, len)
V_BAR(x, LCD_H-8, len);
}
}
}
@ -526,10 +526,10 @@ void menuMainView(uint8_t event)
int8_t len = limit((int16_t)0, (int16_t)(((val+1024) * BAR_HEIGHT) / 2048), (int16_t)BAR_HEIGHT);
#if ROTARY_ENCODERS > 2
#define V_BAR_W 5
V_BAR(LCD_W/2-8+V_BAR_W*i, LCD_H-8, len)
V_BAR(LCD_W/2-8+V_BAR_W*i, LCD_H-8, len);
#else
#define V_BAR_W 5
V_BAR(LCD_W/2-3+V_BAR_W*i, LCD_H-8, len)
V_BAR(LCD_W/2-3+V_BAR_W*i, LCD_H-8, len);
#endif
}
#endif // PCBGRUVIN9X && ROTARY_ENCODERS

View file

@ -624,13 +624,11 @@ void putsStrIdx(coord_t x, coord_t y, const pm_char *str, uint8_t idx, LcdFlags
lcd_outdezNAtt(lcdNextPos, y, idx, att|LEFT, 2);
}
#if defined(PCBTARANIS)
void putsStickName(coord_t x, coord_t y, uint8_t idx, LcdFlags att)
{
uint8_t length = STR_VSRCRAW[0];
lcd_putsnAtt(x, y, STR_VSRCRAW+2+length*(idx+1), length-1, att);
}
#endif
void putsMixerSource(coord_t x, coord_t y, uint32_t idx, LcdFlags att)
{

View file

@ -218,7 +218,7 @@ void lcdDrawTelemetryTopBar();
#define V_BAR(xx, yy, ll) \
lcd_vline(xx-1,yy-ll,ll); \
lcd_vline(xx ,yy-ll,ll); \
lcd_vline(xx+1,yy-ll,ll);
lcd_vline(xx+1,yy-ll,ll)
void lcd_img(coord_t x, coord_t y, const pm_uchar * img, uint8_t idx, LcdFlags att=0);

View file

@ -38,6 +38,21 @@
#define XPOT_DELTA 10
#define XPOT_DELAY 10 /* cycles */
#define BAR_SPACING 12
#define BAR_HEIGHT 22
void drawPotsBars()
{
// Optimization by Mike Blandford
uint8_t x, i, len ; // declare temporary variables
for (x=LCD_W/2-(NUM_POTS/2)*BAR_SPACING+BAR_SPACING/2, i=NUM_STICKS; i<NUM_STICKS+NUM_POTS; x+=BAR_SPACING, i++) {
if (IS_POT_AVAILABLE(i)) {
len = ((calibratedStick[i]+RESX)*BAR_HEIGHT/(RESX*2))+1l; // calculate once per loop
V_BAR(x, LCD_H-8, len);
putsStickName(x-2, LCD_H-6, i, TINSIZE);
}
}
}
void menuCommonCalib(uint8_t event)
{
@ -172,6 +187,7 @@ void menuCommonCalib(uint8_t event)
doMainScreenGraphics();
drawPotsBars();
#if 0
for (int i=POT1; i<=POT_LAST; i++) {
uint8_t steps = 0;
if (reusableBuffer.calib.state == 2) {
@ -185,6 +201,7 @@ void menuCommonCalib(uint8_t event)
lcd_outdezAtt(LCD_W/2-2+(i-POT1)*5, LCD_H-6, steps, TINSIZE);
}
}
#endif
}
void menuGeneralCalib(uint8_t event)

View file

@ -89,7 +89,6 @@ inline MenuFuncP lastPopMenu()
return g_menuStack[g_menuStackPtr+1];
}
void drawPotsBars();
void doMainScreenGraphics();
void menuFirstCalib(uint8_t event);

View file

@ -58,7 +58,6 @@
#define REBOOT_X (LCD_W-FW)
#define VSWITCH_X(i) (((i>=NUM_LOGICAL_SWITCH*3/4) ? BITMAP_X+28 : ((i>=NUM_LOGICAL_SWITCH/2) ? BITMAP_X+25 : ((i>=NUM_LOGICAL_SWITCH/4) ? 21 : 18))) + 3*i)
#define VSWITCH_Y (LCD_H-9)
#define BAR_HEIGHT (31-9)
#define TRIM_LH_X (32+9)
#define TRIM_LV_X 10
#define TRIM_RV_X (LCD_W-11)
@ -88,20 +87,6 @@ const pm_uchar icons[] PROGMEM = {
#define ICON_REBOOT 91, 11
#define ICON_ALTITUDE 102, 9
#define POT_SPACING 5
void drawPotsBars()
{
// Optimization by Mike Blandford
uint8_t x, i, len ; // declare temporary variables
for (x=LCD_W/2-(NUM_POTS/2)*POT_SPACING, i=NUM_STICKS; i<NUM_STICKS+NUM_POTS; x+=POT_SPACING, i++) {
if (IS_POT_AVAILABLE(i)) {
len = ((calibratedStick[i]+RESX)*BAR_HEIGHT/(RESX*2))+1l; // calculate once per loop
V_BAR(x, LCD_H-8, len)
}
}
}
void doMainScreenGraphics()
{
int16_t calibStickVert = calibratedStick[CONVERT_MODE(1)];

View file

@ -354,7 +354,8 @@ extern void boardInit();
#endif
#if defined(PCBTARANIS) && defined(REV9E)
#define IS_POT_AVAILABLE(x) ((x)<POT1 || (x)>POT_LAST || ((g_eeGeneral.potsConfig & (0x03 << (2*((x)-POT1))))!=POT_NONE))
#define IS_SLIDER_AVAILABLE(x) ((x)==SLIDER1 || (x)==SLIDER2 || (g_eeGeneral.slidersConfig & (0x01 << ((x)-SLIDER3))))
#define IS_POT_AVAILABLE(x) ((x)<POT1 || ((x)<=POT_LAST && ((g_eeGeneral.potsConfig & (0x03 << (2*((x)-POT1))))!=0)) || ((x)>=SLIDER3 && IS_SLIDER_AVAILABLE(x)))
#define IS_POT_MULTIPOS(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_MULTIPOS_SWITCH)
#define IS_POT_WITHOUT_DETENT(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsConfig>>(2*((x)-POT1)))&0x03)==POT_WITHOUT_DETENT)
#elif defined(PCBTARANIS) && defined(REVPLUS)