Merge pull request #2034 from NotaRobotexe/MK3

multiple sheets - bug in switching sheets from menu
This commit is contained in:
DRracer 2019-07-24 09:08:17 +02:00 committed by GitHub
commit f60eaa2c71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6494,10 +6494,19 @@ static void change_sheet()
static void change_sheet_from_menu(){
uint8_t next_sheet = selected_sheet+1;
if(next_sheet > 2) next_sheet = 0;
if(is_sheet_initialized(next_sheet)){
eeprom_update_byte(&(EEPROM_Sheets_base->active_sheet), next_sheet);
selected_sheet = next_sheet;
while(true){
if(next_sheet > 2) next_sheet = 0;
if(is_sheet_initialized(next_sheet)){
eeprom_update_byte(&(EEPROM_Sheets_base->active_sheet), next_sheet);
selected_sheet = next_sheet;
break;
}
else if (next_sheet == selected_sheet){
break;
}
else{
next_sheet++;
}
}
menu_back();
}