Merge pull request #1307 from wolfmanjm/upstreamedge
[clinton/Smoothieware.git] / src / modules / tools / toolmanager / ToolManager.cpp
index 08d2643..94a239d 100644 (file)
@@ -7,9 +7,6 @@
 
 #include "libs/Module.h"
 #include "libs/Kernel.h"
-#include <math.h>
-using namespace std;
-#include <vector>
 #include "ToolManager.h"
 #include "Tool.h"
 #include "PublicDataRequest.h"
@@ -26,6 +23,8 @@ using namespace std;
 #include "libs/StreamOutput.h"
 #include "FileStream.h"
 
+#include <math.h>
+
 ToolManager::ToolManager()
 {
     active_tool = 0;
@@ -55,7 +54,7 @@ void ToolManager::on_gcode_received(void *argument)
         } else {
             if(new_tool != this->active_tool) {
                 // We must wait for an empty queue before we can disable the current extruder
-                THEKERNEL->conveyor->wait_for_empty_queue();
+                THEKERNEL->conveyor->wait_for_idle();
                 this->tools[active_tool]->deselect();
                 this->active_tool = new_tool;
                 this->current_tool_name = this->tools[active_tool]->get_name();