[X7] Pots calibration fix - #4143
This commit is contained in:
@@ -45,7 +45,7 @@ void drawPotsBars()
|
||||
{
|
||||
// Optimization by Mike Blandford
|
||||
for (uint8_t x=LCD_W/2 - (NUM_POTS+NUM_SLIDERS-1) * 5 / 2, i=NUM_STICKS; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; x+=5, i++) {
|
||||
if (IS_POT_OR_SLIDER_AVAILABLE(i)) {
|
||||
if (IS_POT_SLIDER_AVAILABLE(i)) {
|
||||
uint8_t len = ((calibratedStick[i]+RESX)*BAR_HEIGHT/(RESX*2))+1l; // calculate once per loop
|
||||
V_BAR(x, LCD_H-8, len);
|
||||
}
|
||||
|
||||
@@ -573,7 +573,7 @@ void menuModelSetup(event_t event)
|
||||
if (g_model.potsWarnMode) {
|
||||
coord_t x = MODEL_SETUP_2ND_COLUMN+28;
|
||||
for (int i=0; i<NUM_POTS+NUM_SLIDERS; ++i) {
|
||||
if (i<NUM_XPOTS && !IS_POT_OR_SLIDER_AVAILABLE(POT1+i)) {
|
||||
if (i<NUM_XPOTS && !IS_POT_SLIDER_AVAILABLE(POT1+i)) {
|
||||
if (attr && (menuHorizontalPosition==i+1)) REPEAT_LAST_CURSOR_MOVE();
|
||||
}
|
||||
else {
|
||||
@@ -608,7 +608,7 @@ void menuModelSetup(event_t event)
|
||||
lcdDrawTextAlignedLeft(y, STR_BEEPCTR);
|
||||
coord_t x = MODEL_SETUP_2ND_COLUMN;
|
||||
for (int i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS+NUM_ROTARY_ENCODERS; i++) {
|
||||
if (i>=POT1 && i<POT1+NUM_XPOTS && !IS_POT_OR_SLIDER_AVAILABLE(i)) {
|
||||
if (i>=POT1 && i<POT1+NUM_XPOTS && !IS_POT_SLIDER_AVAILABLE(i)) {
|
||||
if (attr && menuHorizontalPosition == i) REPEAT_LAST_CURSOR_MOVE();
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ void drawPotsBars()
|
||||
{
|
||||
// Optimization by Mike Blandford
|
||||
for (uint8_t x=LCD_W/2-(NUM_POTS+NUM_SLIDERS)/2*BAR_SPACING+BAR_SPACING/2, i=NUM_STICKS; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; x+=BAR_SPACING, i++) {
|
||||
if (IS_POT_OR_SLIDER_AVAILABLE(i)) {
|
||||
if (IS_POT_SLIDER_AVAILABLE(i)) {
|
||||
uint8_t 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);
|
||||
|
||||
@@ -162,7 +162,7 @@ bool isSourceAvailable(int source)
|
||||
#endif
|
||||
|
||||
if (source>=MIXSRC_FIRST_POT && source<=MIXSRC_LAST_POT) {
|
||||
return IS_POT_OR_SLIDER_AVAILABLE(POT1+source-MIXSRC_FIRST_POT);
|
||||
return IS_POT_SLIDER_AVAILABLE(POT1+source-MIXSRC_FIRST_POT);
|
||||
}
|
||||
|
||||
if (source>=MIXSRC_FIRST_SWITCH && source<=MIXSRC_LAST_SWITCH) {
|
||||
@@ -227,7 +227,7 @@ bool isSourceAvailableInCustomSwitches(int source)
|
||||
bool isInputSourceAvailable(int source)
|
||||
{
|
||||
if (source>=MIXSRC_FIRST_POT && source<=MIXSRC_LAST_POT) {
|
||||
return IS_POT_OR_SLIDER_AVAILABLE(POT1+source-MIXSRC_FIRST_POT);
|
||||
return IS_POT_SLIDER_AVAILABLE(POT1+source-MIXSRC_FIRST_POT);
|
||||
}
|
||||
|
||||
if (source>=MIXSRC_Rud && source<=MIXSRC_MAX)
|
||||
@@ -401,7 +401,7 @@ bool isSwitchAvailableInTimers(int swtch)
|
||||
|
||||
bool isThrottleSourceAvailable(int source)
|
||||
{
|
||||
if (source >= THROTTLE_SOURCE_FIRST_POT && source < THROTTLE_SOURCE_FIRST_POT+NUM_POTS+NUM_SLIDERS && !IS_POT_OR_SLIDER_AVAILABLE(POT1+source-THROTTLE_SOURCE_FIRST_POT))
|
||||
if (source >= THROTTLE_SOURCE_FIRST_POT && source < THROTTLE_SOURCE_FIRST_POT+NUM_POTS+NUM_SLIDERS && !IS_POT_SLIDER_AVAILABLE(POT1+source-THROTTLE_SOURCE_FIRST_POT))
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user