Explorar o código

Include fsensor recovery stats in the last print stats

Yuri D'Elia %!s(int64=5) %!d(string=hai) anos
pai
achega
8fb8ff4bf4
Modificáronse 4 ficheiros con 15 adicións e 5 borrados
  1. 1 0
      Firmware/Marlin_main.cpp
  2. 5 0
      Firmware/fsensor.cpp
  3. 1 0
      Firmware/fsensor.h
  4. 8 5
      Firmware/ultralcd.cpp

+ 1 - 0
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);

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

+ 1 - 0
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

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