From 379d2ee88d4d59a0c0dbff40a473f7e0e2d08c6a Mon Sep 17 00:00:00 2001
From: Daniel Rogge <drogge@tormach.com>
Date: Thu, 31 May 2012 11:01:51 -0500
Subject: [PATCH] This fixes a bug where switching from MODE_MANUAL to MODE_MDI will clear out the S word (settings[2]).
 The S word is a modal G code and should not be cleared by a mode switch.
 This change to GET_EXTERNAL_SPEED() causes it to return the stored S word (spindle speed command) instead
 of the current machine spindle speed.  GET_EXTERNAL_SPEED() is only called by the interp.synch method in rs274ngc_pre.cc.
 Signed-off-by: Daniel Rogge <drogge@tormach.com>

---
 src/emc/task/emccanon.cc |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/emc/task/emccanon.cc b/src/emc/task/emccanon.cc
index 483949b..73438bd 100644
--- a/src/emc/task/emccanon.cc
+++ b/src/emc/task/emccanon.cc
@@ -2542,7 +2542,7 @@ int GET_EXTERNAL_FLOOD()
 double GET_EXTERNAL_SPEED()
 {
     // speed is in RPMs everywhere
-    return emcStatus->motion.spindle.speed;
+    return spindleSpeed;
 }
 
 CANON_DIRECTION GET_EXTERNAL_SPINDLE()
-- 
1.7.0.4

