From 919fba531a6d8d347c2a28e977010ce8aba63106 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Wed, 11 Apr 2018 16:48:47 +0200 Subject: [PATCH] wait for PINDA gcode changed --- Firmware/Marlin_main.cpp | 87 ++++++++++++++++++++-------------------- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index dbbca14dd..f1c175885 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -232,7 +232,7 @@ // M540 - Use S[0|1] to enable or disable the stop SD card print on endstop hit (requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) // M600 - Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal] // M605 - Set dual x-carriage movement mode: S [ X R ] -// M666 - Wait for PINDA thermistor to reach target temperature. +// M860 - Wait for PINDA thermistor to reach target temperature. // M900 - Set LIN_ADVANCE options, if enabled. See Configuration_adv.h for details. // M907 - Set digital trimpot motor current using axis codes. // M908 - Control digital trimpot directly. @@ -4968,48 +4968,6 @@ Sigma_Exit: #endif break; -#ifdef PINDA_THERMISTOR -case 666: // M666 - Wait for PINDA thermistor to reach target temperature. - { - int setTargetPinda = 0; - - if (code_seen('S')) { - setTargetPinda = code_value(); - } else { - break; - } - - LCD_MESSAGERPGM(MSG_PLEASE_WAIT); - - SERIAL_PROTOCOLPGM("Wait for PINDA target temperature:"); - SERIAL_PROTOCOL(setTargetPinda); - SERIAL_PROTOCOLLN(""); - - codenum = millis(); - cancel_heatup = false; - - KEEPALIVE_STATE(NOT_BUSY); - - while ( (!cancel_heatup) && current_temperature_pinda < setTargetPinda) { - if(( millis() - codenum) > 1000 ) //Print Temp Reading every 1 second while waiting. - { - SERIAL_PROTOCOLPGM("P:"); - SERIAL_PROTOCOL_F(current_temperature_pinda,1); - SERIAL_PROTOCOLPGM("/"); - SERIAL_PROTOCOL(setTargetPinda); - SERIAL_PROTOCOLLN(""); - codenum = millis(); - } - manage_heater(); - manage_inactivity(); - lcd_update(); - } - LCD_MESSAGERPGM(MSG_OK); - - break; - } -#endif //PINDA_THERMISTOR - #if defined(FAN_PIN) && FAN_PIN > -1 case 106: //M106 Fan On if (code_seen('S')){ @@ -6264,6 +6222,49 @@ case 666: // M666 - Wait for PINDA thermistor to reach target temperature. } break; +#ifdef PINDA_THERMISTOR + case 860: // M860 - Wait for PINDA thermistor to reach target temperature. + { + int setTargetPinda = 0; + + if (code_seen('S')) { + setTargetPinda = code_value(); + } + else { + break; + } + + LCD_MESSAGERPGM(MSG_PLEASE_WAIT); + + SERIAL_PROTOCOLPGM("Wait for PINDA target temperature:"); + SERIAL_PROTOCOL(setTargetPinda); + SERIAL_PROTOCOLLN(""); + + codenum = millis(); + cancel_heatup = false; + + KEEPALIVE_STATE(NOT_BUSY); + + while ((!cancel_heatup) && current_temperature_pinda < setTargetPinda) { + if ((millis() - codenum) > 1000) //Print Temp Reading every 1 second while waiting. + { + SERIAL_PROTOCOLPGM("P:"); + SERIAL_PROTOCOL_F(current_temperature_pinda, 1); + SERIAL_PROTOCOLPGM("/"); + SERIAL_PROTOCOL(setTargetPinda); + SERIAL_PROTOCOLLN(""); + codenum = millis(); + } + manage_heater(); + manage_inactivity(); + lcd_update(); + } + LCD_MESSAGERPGM(MSG_OK); + + break; + } +#endif //PINDA_THERMISTOR + #ifdef LIN_ADVANCE case 900: // M900: Set LIN_ADVANCE options. gcode_M900();