Fix config with disabled entries
This commit is contained in:
parent
5452f6dd9d
commit
b7fe341739
|
@ -43,41 +43,37 @@ void changer(void){
|
||||||
lcdNl();
|
lcdNl();
|
||||||
|
|
||||||
uint8_t j=0;
|
uint8_t j=0;
|
||||||
for (uint8_t i=0;i<current_offset;i++,j++)
|
for (uint8_t i=0;i<current_offset;i++)
|
||||||
if(the_config[j].disabled)
|
while (the_config[++j].disabled);
|
||||||
j++;
|
|
||||||
|
uint8_t t=0;
|
||||||
|
for (uint8_t i=0;i<menuselection;i++)
|
||||||
|
while (the_config[++t].disabled);
|
||||||
|
|
||||||
for (uint8_t i = current_offset; i < (visible_lines + current_offset) && i < numentries; i++,j++) {
|
for (uint8_t i = current_offset; i < (visible_lines + current_offset) && i < numentries; i++,j++) {
|
||||||
while(the_config[j].disabled)j++;
|
while(the_config[j].disabled)j++;
|
||||||
if(i==0){
|
if(i==0){
|
||||||
lcdPrintln("Save changes:");
|
lcdPrintln("Save changes:");
|
||||||
if (i == menuselection)
|
if (i == t)
|
||||||
lcdPrint("*");
|
lcdPrint("*");
|
||||||
lcdSetCrsrX(14);
|
lcdSetCrsrX(14);
|
||||||
if (i == menuselection)
|
if (i == t)
|
||||||
lcdPrintln("YES");
|
lcdPrintln("YES");
|
||||||
else
|
else
|
||||||
lcdPrintln("no");
|
lcdPrintln("no");
|
||||||
}else{
|
}else{
|
||||||
lcdPrintln(the_config[j].name);
|
lcdPrintln(the_config[j].name);
|
||||||
if (j == menuselection)
|
if (j == t)
|
||||||
lcdPrint("*");
|
lcdPrint("*");
|
||||||
lcdSetCrsrX(14);
|
lcdSetCrsrX(14);
|
||||||
lcdPrint("<");
|
lcdPrint("<");
|
||||||
lcdPrint(IntToStr(the_config[j].value,3,F_LONG));
|
lcdPrint(IntToStr(the_config[j].value,3,F_LONG));
|
||||||
lcdPrintln(">");
|
lcdPrintln(">");
|
||||||
};
|
};
|
||||||
|
lcdRefresh();
|
||||||
}
|
}
|
||||||
lcdRefresh();
|
lcdRefresh();
|
||||||
|
|
||||||
j=menuselection;
|
|
||||||
int t=0;
|
|
||||||
while(j){
|
|
||||||
if(!the_config[t].disabled)
|
|
||||||
j--;
|
|
||||||
t++;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (getInputWaitRepeat()) {
|
switch (getInputWaitRepeat()) {
|
||||||
case BTN_UP:
|
case BTN_UP:
|
||||||
menuselection--;
|
menuselection--;
|
||||||
|
|
Loading…
Reference in New Issue