1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-20 14:55:13 +03:00

Compilation fix

This commit is contained in:
Bertrand Songis 2016-01-08 23:34:57 +01:00
parent 86df9fee4a
commit 87f8ea516b
4 changed files with 33 additions and 32 deletions

View file

@ -22,10 +22,10 @@
#define XPOT_DELTA 10
#define XPOT_DELAY 10 /* cycles */
#define BAR_WIDTH 7
#define BAR_HEIGHT (BOX_WIDTH-9)
#define BAR_INTERVAL 20
#define BAR_BOTTOM 200
#define POT_BAR_WIDTH 7
#define POT_BAR_HEIGHT (BOX_WIDTH-9)
#define POT_BAR_INTERVAL 20
#define POT_BAR_BOTTOM 200
#define LBOX_CENTERX (BOX_WIDTH/2 + 17)
#define RBOX_CENTERX (LCD_W-LBOX_CENTERX)
@ -33,12 +33,12 @@ void drawPotsBars()
{
// Optimization by Mike Blandford
unsigned int x, i, len ; // declare temporary variables
for (x=LCD_W/2-(BAR_INTERVAL*NUM_POTS/2), i=NUM_STICKS; i<NUM_STICKS+NUM_POTS; x+=BAR_INTERVAL, i++) {
for (x=LCD_W/2-(POT_BAR_INTERVAL*NUM_POTS/2), i=NUM_STICKS; i<NUM_STICKS+NUM_POTS; x+=POT_BAR_INTERVAL, i++) {
if (IS_POT_AVAILABLE(i)) {
len = ((calibratedStick[i]+RESX)*BAR_HEIGHT/(RESX*2))+1l; // calculate once per loop
len = ((calibratedStick[i]+RESX)*POT_BAR_HEIGHT/(RESX*2))+1l; // calculate once per loop
// TODO 220 constant
lcdDrawSolidFilledRect(x, BAR_BOTTOM-len, BAR_WIDTH, len, TEXT_COLOR);
putsStickName(x-2, BAR_BOTTOM+5, i, TEXT_COLOR|TINSIZE);
lcdDrawSolidFilledRect(x, POT_BAR_BOTTOM-len, POT_BAR_WIDTH, len, TEXT_COLOR);
putsStickName(x-2, POT_BAR_BOTTOM+5, i, TEXT_COLOR|TINSIZE);
}
}
}
@ -169,7 +169,7 @@ bool menuCommonCalib(evt_t event)
}
}
else {
g_eeGeneral.potsConfig &= ~(0x03<<(2*idx));
// g_eeGeneral.potsConfig &= ~(0x03<<(2*idx));
}
}
}
@ -196,7 +196,7 @@ bool menuCommonCalib(evt_t event)
steps = calib->count + 1;
}
if (steps > 0 && steps <= XPOTS_MULTIPOS_COUNT) {
lcdDrawNumber(LCD_W/2-(BAR_INTERVAL*NUM_POTS/2)+(BAR_INTERVAL*(i-POT1)), BAR_BOTTOM+15, steps, TEXT_COLOR|TINSIZE, 0, "[", "]");
lcdDrawNumber(LCD_W/2-(POT_BAR_INTERVAL*NUM_POTS/2)+(POT_BAR_INTERVAL*(i-POT1)), POT_BAR_BOTTOM+15, steps, TEXT_COLOR|TINSIZE, 0, "[", "]");
}
}

View file

@ -97,7 +97,7 @@
#define MAX_FLIGHT_MODES 9
#define MAX_MIXERS 64
#define MAX_EXPOS 64
#define NUM_LOGICAL_SWITCH 32 // number of custom switches
#define NUM_LOGICAL_SWITCH 64 // number of custom switches
#define NUM_CFN 64 // number of functions assigned to switches
#define MAX_SCRIPTS 9
#define MAX_INPUTS 32

View file

@ -554,7 +554,7 @@ bool getSwitch(swsrc_t swtch)
result = true;
}
else if (cs_idx <= SWSRC_LAST_SWITCH) {
#if defined(PCBTARANIS) // TODO || defined(PCBFLAMENCO)
#if defined(PCBTARANIS) || defined(PCBHORUS) // TODO || defined(PCBFLAMENCO)
if (flags & GETSWITCH_MIDPOS_DELAY)
result = SWITCH_POSITION(cs_idx-SWSRC_FIRST_SWITCH);
else

View file

@ -136,6 +136,7 @@ void menusTask(void * pdata)
break;
}
else if (pwr_check == e_power_press) {
CoTickDelay(MENU_TASK_PERIOD_TICKS);
continue;
}
#else