From 6d4c3b8b272e2cb4ff2570b4739a80ec3fbde272 Mon Sep 17 00:00:00 2001 From: Robert Pelnar Date: Mon, 25 Jun 2018 16:04:47 +0200 Subject: [PATCH 1/2] Farm mode - reset using watchdog for MK3 --- Firmware/Marlin_main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index e86ca3b6..5c3ebf65 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3274,7 +3274,13 @@ void process_commands() } else if (code_seen("RESET")) { // careful! if (farm_mode) { - asm volatile(" jmp 0x3E000"); +#ifdef WATCHDOG + wdt_enable(WDTO_15MS); + cli(); + while(1); +#else //WATCHDOG + asm volatile("jmp 0x3E000"); +#endif //WATCHDOG } else { MYSERIAL.println("Not in farm mode."); From 12de2f95e65c9611c4b687c022e155c5f454ca7e Mon Sep 17 00:00:00 2001 From: Robert Pelnar Date: Mon, 25 Jun 2018 17:29:34 +0200 Subject: [PATCH 2/2] Farm mode: PFW360, PFW361, PFW362, PFW363 --- Firmware/Marlin_main.cpp | 8 +++++++- Firmware/ultralcd.cpp | 2 ++ Firmware/ultralcd_implementation_hitachi_HD44780.h | 2 +- Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h | 2 ++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 5c3ebf65..d02c46e5 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -1174,11 +1174,17 @@ void setup() selectedSerialPort = eeprom_read_byte((uint8_t*)EEPROM_SECOND_SERIAL_ACTIVE); if (selectedSerialPort == 0xFF) selectedSerialPort = 0; if (farm_mode) - { + { no_response = true; //we need confirmation by recieving PRUSA thx important_status = 8; prusa_statistics(8); selectedSerialPort = 1; + //increased extruder current (PFW363) + tmc2130_current_h[E_AXIS] = 36; + tmc2130_current_r[E_AXIS] = 36; + //disabled filament autoload (PFW360) + filament_autoload_enabled = false; + eeprom_update_byte((uint8_t*)EEPROM_FSENS_AUTOLOAD_ENABLED, 0); } MYSERIAL.begin(BAUDRATE); fdev_setup_stream(uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE); //setup uart out stream diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 1ed59689..54a8458d 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -7451,7 +7451,9 @@ static void lcd_send_status() { //send important status messages periodicaly prusa_statistics(important_status, saved_filament_type); NcTime = millis(); +#ifdef FARM_CONNECT_MESSAGE lcd_connect_printer(); +#endif //FARM_CONNECT_MESSAGE } } diff --git a/Firmware/ultralcd_implementation_hitachi_HD44780.h b/Firmware/ultralcd_implementation_hitachi_HD44780.h index 25ce2cea..31ea06c0 100644 --- a/Firmware/ultralcd_implementation_hitachi_HD44780.h +++ b/Firmware/ultralcd_implementation_hitachi_HD44780.h @@ -828,7 +828,7 @@ if (print_sd_status) // Farm number display if (farm_mode) { - lcd.setCursor(0, 6); + lcd.setCursor(6, 2); lcd_printPGM(PSTR(" F")); lcd.print(farm_no); lcd_printPGM(PSTR(" ")); diff --git a/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h index 4c9f2433..984b99dd 100644 --- a/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h @@ -468,6 +468,8 @@ // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. #endif // PIDTEMPBED +//connect message when communication with monitoring broken +//#define FARM_CONNECT_MESSAGE /*----------------------------------- PREHEAT SETTINGS