From 400fec5d9f7ba5fd3a2085eec394825d9a780e91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sun, 31 Jul 2022 11:50:54 +0000 Subject: [PATCH] Reset CustomMsg when Command in progress is None When a Progress report is started, we set the CustomMsg to MMUProgress. But there was an issue where, once the reported "Progress" action was done. We did not reset the CustomMsg to Status. So if we are printing from the SD card, the file name is not displayed on the LCD. --- Firmware/mmu2_reporting.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Firmware/mmu2_reporting.cpp b/Firmware/mmu2_reporting.cpp index db4c0de08..70e2f2b66 100644 --- a/Firmware/mmu2_reporting.cpp +++ b/Firmware/mmu2_reporting.cpp @@ -262,8 +262,16 @@ void ReportErrorHook(uint16_t ec, uint8_t res) { } void ReportProgressHook(CommandInProgress cip, uint16_t ec) { - custom_message_type = CustomMsg::MMUProgress; - lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); + if (cip != CommandInProgress::NoCommand) + { + custom_message_type = CustomMsg::MMUProgress; + lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); + } else { + // If there is no command in progress we can display other + // useful information such as the name of the SD file + // being printed + custom_message_type = CustomMsg::Status; + } } } // namespace MMU2