Pārlūkot izejas kodu

Changed M401 to M0/M1 as suggested, so they match normal CNC stop commands.

Daid 13 gadus atpakaļ
vecāks
revīzija
4d7fe7115f
1 mainītis faili ar 31 papildinājumiem un 29 dzēšanām
  1. 31
    29
      Marlin/Marlin.pde

+ 31
- 29
Marlin/Marlin.pde Parādīt failu

56
 // G92 - Set current position to cordinates given
56
 // G92 - Set current position to cordinates given
57
 
57
 
58
 //RepRap M Codes
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
 // M104 - Set extruder target temp
61
 // M104 - Set extruder target temp
60
 // M105 - Read current temp
62
 // M105 - Read current temp
61
 // M106 - Fan on
63
 // M106 - Fan on
107
 // M302 - Allow cold extrudes
109
 // M302 - Allow cold extrudes
108
 // M303 - PID relay autotune S<temperature> sets the target temperature. (default target temperature = 150C)
110
 // M303 - PID relay autotune S<temperature> sets the target temperature. (default target temperature = 150C)
109
 // M400 - Finish all moves
111
 // M400 - Finish all moves
110
-// M401 - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
111
 // M500 - stores paramters in EEPROM
112
 // M500 - stores paramters in EEPROM
112
 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).  
113
 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).  
113
 // M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
114
 // M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
709
   {
710
   {
710
     switch( (int)code_value() ) 
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
     case 17:
742
     case 17:
713
         LCD_MESSAGEPGM(MSG_NO_MOVE);
743
         LCD_MESSAGEPGM(MSG_NO_MOVE);
714
         enable_x(); 
744
         enable_x(); 
1266
       st_synchronize();
1296
       st_synchronize();
1267
     }
1297
     }
1268
     break;
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
     case 500: // Store settings in EEPROM
1299
     case 500: // Store settings in EEPROM
1298
     {
1300
     {
1299
         EEPROM_StoreSettings();
1301
         EEPROM_StoreSettings();

Notiek ielāde…
Atcelt
Saglabāt