diff --git a/radio/src/gui/9X/lcd.h b/radio/src/gui/9X/lcd.h index e60f15b5c..1789429ab 100755 --- a/radio/src/gui/9X/lcd.h +++ b/radio/src/gui/9X/lcd.h @@ -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); diff --git a/radio/src/gui/9X/view_main.cpp b/radio/src/gui/9X/view_main.cpp index 0ba4813de..3073c633f 100644 --- a/radio/src/gui/9X/view_main.cpp +++ b/radio/src/gui/9X/view_main.cpp @@ -67,7 +67,7 @@ void drawPotsBars() for (x=LCD_W/2-5, i=NUM_STICKS; i 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 diff --git a/radio/src/gui/Taranis/lcd.cpp b/radio/src/gui/Taranis/lcd.cpp index 829b01a95..5c2692e28 100755 --- a/radio/src/gui/Taranis/lcd.cpp +++ b/radio/src/gui/Taranis/lcd.cpp @@ -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) { diff --git a/radio/src/gui/Taranis/lcd.h b/radio/src/gui/Taranis/lcd.h index 57311f608..a89c57dd1 100755 --- a/radio/src/gui/Taranis/lcd.h +++ b/radio/src/gui/Taranis/lcd.h @@ -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); diff --git a/radio/src/gui/Taranis/menu_general_calib.cpp b/radio/src/gui/Taranis/menu_general_calib.cpp index 1c4c015c1..2dfb41718 100755 --- a/radio/src/gui/Taranis/menu_general_calib.cpp +++ b/radio/src/gui/Taranis/menu_general_calib.cpp @@ -36,8 +36,23 @@ #include "../../opentx.h" -#define XPOT_DELTA 10 -#define XPOT_DELAY 10 /* cycles */ +#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_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; iPOT_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)=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) @@ -966,26 +967,26 @@ enum Analogs { STICK3, STICK4, #if defined(PCBTARANIS) - POT1, - POT2, - POT3, - #if defined(REV9E) - POT4, - POT_LAST = POT4, - #else - POT_LAST = POT3, - #endif - SLIDER1, - SLIDER2, - #if defined(REV9E) - SLIDER3, - SLIDER4, - #endif -#else - POT1, - POT2, - POT3, + POT1, + POT2, + POT3, + #if defined(REV9E) + POT4, + POT_LAST = POT4, + #else POT_LAST = POT3, + #endif + SLIDER1, + SLIDER2, + #if defined(REV9E) + SLIDER3, + SLIDER4, + #endif +#else + POT1, + POT2, + POT3, + POT_LAST = POT3, #endif #if defined(TELEMETRY_MOD_14051) || defined(TELEMETRY_MOD_14051_SWAPPED) // When the mod is applied, ADC7 is connected to 14051's X pin and TX_VOLTAGE