浏览代码

Farm mode error reporting

akukan 8 年之前
父节点
当前提交
6f203c4735
共有 2 个文件被更改,包括 23 次插入2 次删除
  1. 8 0
      Firmware/temperature.cpp
  2. 15 2
      Firmware/ultralcd.cpp

+ 8 - 0
Firmware/temperature.cpp

@@ -1119,7 +1119,9 @@ void temp_runaway_check(int _heater_id, float _target_temperature, float _curren
 
 					if (__preheat_errors > 5)
 					{
+						if (farm_mode) { prusa_statistics(0); }
 						temp_runaway_stop(true);
+						if (farm_mode) { prusa_statistics(91); }
 					}
 					__preheat_start = _current_temperature;
 					__preheat_counter = 0;
@@ -1154,7 +1156,9 @@ void temp_runaway_check(int _heater_id, float _target_temperature, float _curren
 					temp_runaway_error_counter[_heater_id]++;
 					if (temp_runaway_error_counter[_heater_id] * 2 > __timeout)
 					{
+						if (farm_mode) { prusa_statistics(0); }
 						temp_runaway_stop(false);
+						if (farm_mode) { prusa_statistics(90); }
 					}
 				}
 			}
@@ -1269,6 +1273,7 @@ void max_temp_error(uint8_t e) {
     WRITE(BEEPER, 1);
     // fanSpeed will consumed by the check_axes_activity() routine.
     fanSpeed=255;
+	if (farm_mode) { prusa_statistics(93); }
 }
 
 void min_temp_error(uint8_t e) {
@@ -1282,6 +1287,8 @@ void min_temp_error(uint8_t e) {
   #ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
   Stop();
   #endif
+  if (farm_mode) { prusa_statistics(92); }
+
 }
 
 void bed_max_temp_error(void) {
@@ -1296,6 +1303,7 @@ void bed_max_temp_error(void) {
   #ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
   Stop();
   #endif
+
 }
 
 void bed_min_temp_error(void) {

+ 15 - 2
Firmware/ultralcd.cpp

@@ -392,7 +392,7 @@ static void lcd_status_screen()
 		farm_timer--;
 		if (farm_timer < 1)
 		{
-			farm_timer = 90;
+			farm_timer = 180;
 			prusa_statistics(0);
 		}
 		switch (farm_timer)
@@ -1856,7 +1856,20 @@ void prusa_statistics(int _message) {
     case 22: // waiting for filament change
         SERIAL_ECHOLN("{[PRN:5]}");
         break;
-            
+	
+	case 90: // Error - Thermal Runaway
+		SERIAL_ECHOLN("{[ERR:1]}");
+		break;
+	case 91: // Error - Thermal Runaway Preheat
+		SERIAL_ECHOLN("{[ERR:2]}");
+		break;
+	case 92: // Error - Min temp
+		SERIAL_ECHOLN("{[ERR:3]}");
+		break;
+	case 93: // Error - Max temp
+		SERIAL_ECHOLN("{[ERR:4]}");
+		break;
+
     case 99:		// heartbeat
         SERIAL_ECHO("{[PRN:99]");
         prusa_stat_temperatures();