Browse Source

Merge pull request #3108 from AnHardt/M110+

M110 and M29 rework
Scott Lahteine 8 years ago
parent
commit
b7928a000a
1 changed files with 16 additions and 4 deletions
  1. 16
    4
      Marlin/Marlin_main.cpp

+ 16
- 4
Marlin/Marlin_main.cpp View File

756
           // M29 closes the file
756
           // M29 closes the file
757
           card.closefile();
757
           card.closefile();
758
           SERIAL_PROTOCOLLNPGM(MSG_FILE_SAVED);
758
           SERIAL_PROTOCOLLNPGM(MSG_FILE_SAVED);
759
+          ok_to_send();
759
         }
760
         }
760
         else {
761
         else {
761
           // Write the string from the read buffer to SD
762
           // Write the string from the read buffer to SD
763
           if (card.logging)
764
           if (card.logging)
764
             process_next_command(); // The card is saving because it's logging
765
             process_next_command(); // The card is saving because it's logging
765
           else
766
           else
766
-            SERIAL_PROTOCOLLNPGM(MSG_OK);
767
+            ok_to_send();
767
         }
768
         }
768
       }
769
       }
769
       else
770
       else
4053
 #endif // HAS_TEMP_BED
4054
 #endif // HAS_TEMP_BED
4054
 
4055
 
4055
 /**
4056
 /**
4057
+ * M110: Set Current Line Number
4058
+ */
4059
+inline void gcode_M110() {
4060
+  if (code_seen('N')) gcode_N = code_value_long();
4061
+}
4062
+
4063
+/**
4056
  * M111: Set the debug level
4064
  * M111: Set the debug level
4057
  */
4065
  */
4058
 inline void gcode_M111() {
4066
 inline void gcode_M111() {
5926
         gcode_M104();
5934
         gcode_M104();
5927
         break;
5935
         break;
5928
 
5936
 
5937
+      case 110: // M110: Set Current Line Number
5938
+        gcode_M110();
5939
+        break;
5940
+
5929
       case 111: // M111: Set debug level
5941
       case 111: // M111: Set debug level
5930
         gcode_M111();
5942
         gcode_M111();
5931
         break;
5943
         break;
7173
   cli();   // disable interrupts
7185
   cli();   // disable interrupts
7174
   suicide();
7186
   suicide();
7175
   while (1) {
7187
   while (1) {
7176
-	#if ENABLED(USE_WATCHDOG)
7177
-	  watchdog_reset();
7178
-	#endif
7188
+    #if ENABLED(USE_WATCHDOG)
7189
+      watchdog_reset();
7190
+    #endif
7179
   } // Wait for reset
7191
   } // Wait for reset
7180
 }
7192
 }
7181
 
7193
 

Loading…
Cancel
Save