Browse Source

Merge pull request #851 from DanNixon/estop

Implemented M112
nothinman 11 years ago
parent
commit
aed5ec008a
2 changed files with 12 additions and 0 deletions
  1. 11
    0
      Marlin/Marlin_main.cpp
  2. 1
    0
      README.md

+ 11
- 0
Marlin/Marlin_main.cpp View File

@@ -673,6 +673,11 @@ void get_command()
673 673
           }
674 674
 
675 675
         }
676
+
677
+        //If command was e-stop process now
678
+        if(strcmp(cmdbuffer[bufindw], "M112") == 0)
679
+          kill();
680
+        
676 681
         bufindw = (bufindw + 1)%BUFSIZE;
677 682
         buflen += 1;
678 683
       }
@@ -1830,6 +1835,9 @@ void process_commands()
1830 1835
 #endif
1831 1836
       setWatch();
1832 1837
       break;
1838
+    case 112: //  M112 -Emergency Stop
1839
+      kill();
1840
+      break;
1833 1841
     case 140: // M140 set bed temp
1834 1842
       if (code_seen('S')) setTargetBed(code_value());
1835 1843
       break;
@@ -3426,6 +3434,9 @@ void handle_status_leds(void) {
3426 3434
 
3427 3435
 void manage_inactivity()
3428 3436
 {
3437
+  if(buflen < (BUFSIZE-1))
3438
+    get_command();
3439
+
3429 3440
   if( (millis() - previous_millis_cmd) >  max_inactive_time )
3430 3441
     if(max_inactive_time)
3431 3442
       kill();

+ 1
- 0
README.md View File

@@ -195,6 +195,7 @@ M Codes
195 195
 *  M107 - Fan off
196 196
 *  M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
197 197
 *         Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
198
+*  M112 - Emergency stop
198 199
 *  M114 - Output current position to serial port
199 200
 *  M115 - Capabilities string
200 201
 *  M117 - display message

Loading…
Cancel
Save