From 8fb8ff4bf43eb371217ba9b80b4ea64cf8f7cee0 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Sun, 2 Jun 2019 18:00:31 +0200 Subject: [PATCH] Include fsensor recovery stats in the last print stats --- Firmware/Marlin_main.cpp | 1 + Firmware/fsensor.cpp | 5 +++++ Firmware/fsensor.h | 1 + Firmware/ultralcd.cpp | 13 ++++++++----- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 43e3081f..0a1e5439 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -634,6 +634,7 @@ void crashdet_cancel() void failstats_reset_print() { + fsensor_softfail = 0; eeprom_update_byte((uint8_t *)EEPROM_CRASH_COUNT_X, 0); eeprom_update_byte((uint8_t *)EEPROM_CRASH_COUNT_Y, 0); eeprom_update_byte((uint8_t *)EEPROM_FERROR_COUNT, 0); diff --git a/Firmware/fsensor.cpp b/Firmware/fsensor.cpp index f4cb647a..19c8b1f8 100755 --- a/Firmware/fsensor.cpp +++ b/Firmware/fsensor.cpp @@ -83,6 +83,8 @@ uint8_t fsensor_autoload_c; uint32_t fsensor_autoload_last_millis; // uint8_t fsensor_autoload_sum; +// +uint8_t fsensor_softfail = 0; //! @} @@ -598,7 +600,10 @@ void fsensor_update(void) fsensor_oq_meassure_enabled = oq_meassure_enabled_tmp; if (!err) + { printf_P(PSTR("fsensor_err_cnt = 0\n")); + ++fsensor_softfail; + } else fsensor_enque_M600(); } diff --git a/Firmware/fsensor.h b/Firmware/fsensor.h index 5ed7f7fc..fba131db 100755 --- a/Firmware/fsensor.h +++ b/Firmware/fsensor.h @@ -14,6 +14,7 @@ extern bool fsensor_enabled; extern bool fsensor_not_responding; //enable/disable quality meassurement extern bool fsensor_oq_meassure_enabled; +extern uint8_t fsensor_softfail; //! @name save restore printing diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index cefd9b8c..0461ff80 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -1796,11 +1796,14 @@ static void lcd_menu_fails_stats_print() uint8_t crashX = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_X); uint8_t crashY = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_Y); lcd_home(); - lcd_printf_P(failStatsFmt, - _i("Last print failures"), ////c=20 r=1 - _i("Power failures"), power, ////c=14 r=1 - _i("Filam. runouts"), filam, ////c=14 r=1 - _i("Crash"), crashX, crashY); ////c=7 r=1 + lcd_printf_P(PSTR("%S\n" + " %S %-3d\n" + " %S H %-3d S %-3d\n" + " %S X %-3d Y %-3d"), + _i("Last print failures"), + _i("Power failures"), power, + _i("Runouts"), filam, fsensor_softfail, + _i("Crash"), crashX, crashY); menu_back_if_clicked_fb(); }