|
@@ -67,17 +67,9 @@
|
67
|
67
|
// G91 - Use Relative Coordinates
|
68
|
68
|
// G92 - Set current position to cordinates given
|
69
|
69
|
|
70
|
|
-//RepRap M Codes
|
|
70
|
+// M Codes
|
71
|
71
|
// M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
|
72
|
72
|
// M1 - Same as M0
|
73
|
|
-// M104 - Set extruder target temp
|
74
|
|
-// M105 - Read current temp
|
75
|
|
-// M106 - Fan on
|
76
|
|
-// M107 - Fan off
|
77
|
|
-// M109 - Wait for extruder current temp to reach target temp.
|
78
|
|
-// M114 - Display current position
|
79
|
|
-
|
80
|
|
-//Custom M Codes
|
81
|
73
|
// M17 - Enable/Power all stepper motors
|
82
|
74
|
// M18 - Disable all stepper motors; same as M84
|
83
|
75
|
// M20 - List SD card
|
|
@@ -101,6 +93,12 @@
|
101
|
93
|
// or use S<seconds> to specify an inactivity timeout, after which the steppers will be disabled. S0 to disable the timeout.
|
102
|
94
|
// M85 - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
|
103
|
95
|
// M92 - Set axis_steps_per_unit - same syntax as G92
|
|
96
|
+// M104 - Set extruder target temp
|
|
97
|
+// M105 - Read current temp
|
|
98
|
+// M106 - Fan on
|
|
99
|
+// M107 - Fan off
|
|
100
|
+// M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
|
|
101
|
+// Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
|
104
|
102
|
// M114 - Output current position to serial port
|
105
|
103
|
// M115 - Capabilities string
|
106
|
104
|
// M117 - display message
|
|
@@ -110,7 +108,8 @@
|
110
|
108
|
// M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil)
|
111
|
109
|
// M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil)
|
112
|
110
|
// M140 - Set bed target temp
|
113
|
|
-// M190 - Wait for bed current temp to reach target temp.
|
|
111
|
+// M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating
|
|
112
|
+// Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
|
114
|
113
|
// M200 - Set filament diameter
|
115
|
114
|
// M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
|
116
|
115
|
// M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!
|
|
@@ -242,6 +241,9 @@ bool Stopped=false;
|
242
|
241
|
Servo servos[NUM_SERVOS];
|
243
|
242
|
#endif
|
244
|
243
|
|
|
244
|
+bool CooldownNoWait = true;
|
|
245
|
+bool target_direction;
|
|
246
|
+
|
245
|
247
|
//===========================================================================
|
246
|
248
|
//=============================ROUTINES=============================
|
247
|
249
|
//===========================================================================
|
|
@@ -1161,7 +1163,13 @@ void process_commands()
|
1161
|
1163
|
#ifdef AUTOTEMP
|
1162
|
1164
|
autotemp_enabled=false;
|
1163
|
1165
|
#endif
|
1164
|
|
- if (code_seen('S')) setTargetHotend(code_value(), tmp_extruder);
|
|
1166
|
+ if (code_seen('S')) {
|
|
1167
|
+ setTargetHotend(code_value(), tmp_extruder);
|
|
1168
|
+ CooldownNoWait = true;
|
|
1169
|
+ } else if (code_seen('R')) {
|
|
1170
|
+ setTargetHotend(code_value(), tmp_extruder);
|
|
1171
|
+ CooldownNoWait = false;
|
|
1172
|
+ }
|
1165
|
1173
|
#ifdef AUTOTEMP
|
1166
|
1174
|
if (code_seen('S')) autotemp_min=code_value();
|
1167
|
1175
|
if (code_seen('B')) autotemp_max=code_value();
|
|
@@ -1176,7 +1184,7 @@ void process_commands()
|
1176
|
1184
|
codenum = millis();
|
1177
|
1185
|
|
1178
|
1186
|
/* See if we are heating up or cooling down */
|
1179
|
|
- bool target_direction = isHeatingHotend(tmp_extruder); // true if heating, false if cooling
|
|
1187
|
+ target_direction = isHeatingHotend(tmp_extruder); // true if heating, false if cooling
|
1180
|
1188
|
|
1181
|
1189
|
#ifdef TEMP_RESIDENCY_TIME
|
1182
|
1190
|
long residencyStart;
|
|
@@ -1232,9 +1240,18 @@ void process_commands()
|
1232
|
1240
|
case 190: // M190 - Wait for bed heater to reach target.
|
1233
|
1241
|
#if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1
|
1234
|
1242
|
LCD_MESSAGEPGM(MSG_BED_HEATING);
|
1235
|
|
- if (code_seen('S')) setTargetBed(code_value());
|
|
1243
|
+ if (code_seen('S')) {
|
|
1244
|
+ setTargetBed(code_value());
|
|
1245
|
+ CooldownNoWait = true;
|
|
1246
|
+ } else if (code_seen('R')) {
|
|
1247
|
+ setTargetBed(code_value());
|
|
1248
|
+ CooldownNoWait = false;
|
|
1249
|
+ }
|
1236
|
1250
|
codenum = millis();
|
1237
|
|
- while(isHeatingBed())
|
|
1251
|
+
|
|
1252
|
+ target_direction = isHeatingBed(); // true if heating, false if cooling
|
|
1253
|
+
|
|
1254
|
+ while ( target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false)) )
|
1238
|
1255
|
{
|
1239
|
1256
|
if(( millis() - codenum) > 1000 ) //Print Temp Reading every 1 second while heating up.
|
1240
|
1257
|
{
|