temperaturecontrol: allow setting background tool without activating
[clinton/Smoothieware.git] / src / modules / tools / toolmanager / ToolManager.cpp
index 94a239d..72e4985 100644 (file)
@@ -43,8 +43,11 @@ void ToolManager::on_gcode_received(void *argument)
 {
     Gcode *gcode = static_cast<Gcode*>(argument);
 
-    if( gcode->has_letter('T') ) {
+    if( gcode->has_letter('T') && !gcode->has_m) {
         int new_tool = gcode->get_value('T');
+       char buff[32]; // should be big enough for any status
+       int n = snprintf(buff, sizeof(buff), "T%d,T%d switching ", this->active_tool, new_tool);
+       gcode->txt_after_ok.append(buff, n);
         if(new_tool >= (int)this->tools.size() || new_tool < 0) {
             // invalid tool
             char buf[32]; // should be big enough for any status