Parcourir la source

Fix farmless mode

Alex Voinea il y a 2 ans
Parent
commit
d1c30c338f
3 fichiers modifiés avec 11 ajouts et 4 suppressions
  1. 1 2
      Firmware/Marlin_main.cpp
  2. 9 2
      Firmware/Prusa_farm.cpp
  3. 1 0
      Firmware/Prusa_farm.h

+ 1 - 2
Firmware/Marlin_main.cpp

@@ -758,8 +758,7 @@ static void factory_reset(char level)
 		// Force the "Follow calibration flow" message at the next boot up.
 		calibration_status_store(CALIBRATION_STATUS_Z_CALIBRATION);
 		eeprom_write_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 2); //run wizard
-		farm_mode = false;
-		eeprom_update_byte((uint8_t*)EEPROM_FARM_MODE, farm_mode);
+		farm_disable();
 
 #ifdef FILAMENT_SENSOR
 		fsensor_enable();

+ 9 - 2
Firmware/Prusa_farm.cpp

@@ -394,13 +394,17 @@ void farm_gcode_g98() {
 }
 
 void farm_gcode_g99() {
-    farm_mode = 0;
+    farm_disable();
     printer_connected = true;
-    eeprom_update_byte((unsigned char *)EEPROM_FARM_MODE, farm_mode);
     lcd_update(2);
     fCheckModeInit(); // alternatively invoke printer reset
 }
 
+void farm_disable() {
+    farm_mode = false;
+    eeprom_update_byte((uint8_t*)EEPROM_FARM_MODE, farm_mode);
+}
+
 #else //PRUSA_FARM
 
 void prusa_statistics(_UNUSED uint8_t message) {
@@ -425,5 +429,8 @@ void farm_gcode_g98() {
 void farm_gcode_g99() {
 }
 
+void farm_disable() {
+}
+
 #endif //PRUSA_FARM
 

+ 1 - 0
Firmware/Prusa_farm.h

@@ -16,3 +16,4 @@ extern void farm_mode_init();
 extern bool farm_prusa_code_seen();
 extern void farm_gcode_g98();
 extern void farm_gcode_g99();
+extern void farm_disable();