|
@@ -56,6 +56,8 @@
|
56
|
56
|
// G92 - Set current position to cordinates given
|
57
|
57
|
|
58
|
58
|
//RepRap M Codes
|
|
59
|
+// M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
|
|
60
|
+// M1 - Same as M0
|
59
|
61
|
// M104 - Set extruder target temp
|
60
|
62
|
// M105 - Read current temp
|
61
|
63
|
// M106 - Fan on
|
|
@@ -107,7 +109,6 @@
|
107
|
109
|
// M302 - Allow cold extrudes
|
108
|
110
|
// M303 - PID relay autotune S<temperature> sets the target temperature. (default target temperature = 150C)
|
109
|
111
|
// M400 - Finish all moves
|
110
|
|
-// M401 - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
|
111
|
112
|
// M500 - stores paramters in EEPROM
|
112
|
113
|
// M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
|
113
|
114
|
// M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to.
|
|
@@ -709,6 +710,35 @@ void process_commands()
|
709
|
710
|
{
|
710
|
711
|
switch( (int)code_value() )
|
711
|
712
|
{
|
|
713
|
+#ifdef ULTRA_LCD
|
|
714
|
+ case 0: // M0 - Unconditional stop - Wait for user button press on LCD
|
|
715
|
+ case 1: // M1 - Conditional stop - Wait for user button press on LCD
|
|
716
|
+ {
|
|
717
|
+ LCD_MESSAGEPGM(MSG_USERWAIT);
|
|
718
|
+ codenum = 0;
|
|
719
|
+ if(code_seen('P')) codenum = code_value(); // milliseconds to wait
|
|
720
|
+ if(code_seen('S')) codenum = code_value() * 1000; // seconds to wait
|
|
721
|
+
|
|
722
|
+ st_synchronize();
|
|
723
|
+ previous_millis_cmd = millis();
|
|
724
|
+ if (codenum > 0)
|
|
725
|
+ {
|
|
726
|
+ codenum += millis(); // keep track of when we started waiting
|
|
727
|
+ while(millis() < codenum && !CLICKED){
|
|
728
|
+ manage_heater();
|
|
729
|
+ manage_inactivity(1);
|
|
730
|
+ LCD_STATUS;
|
|
731
|
+ }
|
|
732
|
+ }else{
|
|
733
|
+ while(!CLICKED) {
|
|
734
|
+ manage_heater();
|
|
735
|
+ manage_inactivity(1);
|
|
736
|
+ LCD_STATUS;
|
|
737
|
+ }
|
|
738
|
+ }
|
|
739
|
+ }
|
|
740
|
+ break;
|
|
741
|
+#endif
|
712
|
742
|
case 17:
|
713
|
743
|
LCD_MESSAGEPGM(MSG_NO_MOVE);
|
714
|
744
|
enable_x();
|
|
@@ -1266,34 +1296,6 @@ void process_commands()
|
1266
|
1296
|
st_synchronize();
|
1267
|
1297
|
}
|
1268
|
1298
|
break;
|
1269
|
|
-#ifdef ULTRA_LCD
|
1270
|
|
- case 401: // M401 - Wait for user button press on LCD
|
1271
|
|
- {
|
1272
|
|
- LCD_MESSAGEPGM(MSG_USERWAIT);
|
1273
|
|
- codenum = 0;
|
1274
|
|
- if(code_seen('P')) codenum = code_value(); // milliseconds to wait
|
1275
|
|
- if(code_seen('S')) codenum = code_value() * 1000; // seconds to wait
|
1276
|
|
-
|
1277
|
|
- st_synchronize();
|
1278
|
|
- previous_millis_cmd = millis();
|
1279
|
|
- if (codenum > 0)
|
1280
|
|
- {
|
1281
|
|
- codenum += millis(); // keep track of when we started waiting
|
1282
|
|
- while(millis() < codenum && !CLICKED){
|
1283
|
|
- manage_heater();
|
1284
|
|
- manage_inactivity(1);
|
1285
|
|
- LCD_STATUS;
|
1286
|
|
- }
|
1287
|
|
- }else{
|
1288
|
|
- while(!CLICKED) {
|
1289
|
|
- manage_heater();
|
1290
|
|
- manage_inactivity(1);
|
1291
|
|
- LCD_STATUS;
|
1292
|
|
- }
|
1293
|
|
- }
|
1294
|
|
- }
|
1295
|
|
- break;
|
1296
|
|
-#endif
|
1297
|
1299
|
case 500: // Store settings in EEPROM
|
1298
|
1300
|
{
|
1299
|
1301
|
EEPROM_StoreSettings();
|