Include fsensor recovery stats in the last print stats

This commit is contained in:
Yuri D'Elia 2019-06-02 18:00:31 +02:00
parent e8ce5e140e
commit 8fb8ff4bf4
4 changed files with 15 additions and 5 deletions

View File

@ -634,6 +634,7 @@ void crashdet_cancel()
void failstats_reset_print() 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_X, 0);
eeprom_update_byte((uint8_t *)EEPROM_CRASH_COUNT_Y, 0); eeprom_update_byte((uint8_t *)EEPROM_CRASH_COUNT_Y, 0);
eeprom_update_byte((uint8_t *)EEPROM_FERROR_COUNT, 0); eeprom_update_byte((uint8_t *)EEPROM_FERROR_COUNT, 0);

View File

@ -83,6 +83,8 @@ uint8_t fsensor_autoload_c;
uint32_t fsensor_autoload_last_millis; uint32_t fsensor_autoload_last_millis;
// //
uint8_t fsensor_autoload_sum; 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; fsensor_oq_meassure_enabled = oq_meassure_enabled_tmp;
if (!err) if (!err)
{
printf_P(PSTR("fsensor_err_cnt = 0\n")); printf_P(PSTR("fsensor_err_cnt = 0\n"));
++fsensor_softfail;
}
else else
fsensor_enque_M600(); fsensor_enque_M600();
} }

View File

@ -14,6 +14,7 @@ extern bool fsensor_enabled;
extern bool fsensor_not_responding; extern bool fsensor_not_responding;
//enable/disable quality meassurement //enable/disable quality meassurement
extern bool fsensor_oq_meassure_enabled; extern bool fsensor_oq_meassure_enabled;
extern uint8_t fsensor_softfail;
//! @name save restore printing //! @name save restore printing

View File

@ -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 crashX = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_X);
uint8_t crashY = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_Y); uint8_t crashY = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_Y);
lcd_home(); lcd_home();
lcd_printf_P(failStatsFmt, lcd_printf_P(PSTR("%S\n"
_i("Last print failures"), ////c=20 r=1 " %S %-3d\n"
_i("Power failures"), power, ////c=14 r=1 " %S H %-3d S %-3d\n"
_i("Filam. runouts"), filam, ////c=14 r=1 " %S X %-3d Y %-3d"),
_i("Crash"), crashX, crashY); ////c=7 r=1 _i("Last print failures"),
_i("Power failures"), power,
_i("Runouts"), filam, fsensor_softfail,
_i("Crash"), crashX, crashY);
menu_back_if_clicked_fb(); menu_back_if_clicked_fb();
} }