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()
{
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);

View File

@ -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();
}

View File

@ -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

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 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();
}