From 5643d16c0139e9db1eb9bf3f9d9594943c98f7b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Thu, 16 Feb 2023 21:04:14 +0000 Subject: [PATCH] cleanup: remove redundant lcd_update in cashdet_detected There is no need to repeat: lcd_update_enable(true); lcd_update(2); Also lcd_clear() is redundant because lcd_update(2) will clear the LCD Change in memory: Flash: -16 bytes SRAM: 0 bytes --- Firmware/Marlin_main.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index b82105d90..07c2cfde6 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -585,24 +585,17 @@ void crashdet_detected(uint8_t mask) crashDetTimer.start(); crashDet_axes |= mask; - lcd_update_enable(true); - lcd_clear(); - lcd_update(2); - - if (mask & X_AXIS_MASK) - { + if (mask & X_AXIS_MASK) { eeprom_increment_byte((uint8_t*)EEPROM_CRASH_COUNT_X); eeprom_increment_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT); } - if (mask & Y_AXIS_MASK) - { + if (mask & Y_AXIS_MASK) { eeprom_increment_byte((uint8_t*)EEPROM_CRASH_COUNT_Y); eeprom_increment_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT); } - lcd_update_enable(true); - lcd_update(2); - + lcd_update_enable(true); + lcd_update(2); // prepare the status message with the _current_ axes status crashdet_fmt_error(msg, mask); lcd_setstatus(msg);