Merge pull request #533 from bubnikv/M221_fix

Fix of a regression bug, caused by pre-calculating the extrudemultiply
This commit is contained in:
PavelSindler 2018-03-07 16:03:50 +01:00 committed by GitHub
commit 33a7723fba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,6 +90,18 @@ union MenuData
int rear2;
} adjustBed;
struct TuneMenu
{
// editMenuParentState is used when an edit menu is entered, so it knows
// the return menu and encoder state.
struct EditMenuParentState editMenuParentState;
// To recognize, whether the menu has been just initialized.
int8_t status;
// Backup of extrudemultiply, to recognize, that the value has been changed and
// it needs to be applied.
int16_t extrudemultiply;
} tuneMenu;
// editMenuParentState is used when an edit menu is entered, so it knows
// the return menu and encoder state.
struct EditMenuParentState editMenuParentState;
@ -5445,6 +5457,16 @@ static void lcd_colorprint_change() {
static void lcd_tune_menu()
{
if (menuData.tuneMenu.status == 0) {
// Menu was entered. Mark the menu as entered and save the current extrudemultiply value.
menuData.tuneMenu.status = 1;
menuData.tuneMenu.extrudemultiply = extrudemultiply;
} else if (menuData.tuneMenu.extrudemultiply != extrudemultiply) {
// extrudemultiply has been changed from the child menu. Apply the new value.
menuData.tuneMenu.extrudemultiply = extrudemultiply;
calculate_extruder_multipliers();
}
EEPROM_read(EEPROM_SILENT, (uint8_t*)&SilentModeMenu, sizeof(SilentModeMenu));