fix using is queue empty when it should be is_idle
[clinton/Smoothieware.git] / src / modules / robot / Planner.cpp
index e216472..bc47572 100644 (file)
@@ -53,7 +53,7 @@ void Planner::config_load()
 void Planner::append_block( ActuatorCoordinates &actuator_pos, uint8_t n_motors, float rate_mm_s, float distance, float *unit_vec, float acceleration)
 {
     // Create ( recycle ) a new block
-    Block* block = THEKERNEL->conveyor->queue.head_ref();
+    Block* block = THECONVEYOR->queue.head_ref();
 
     // Direction bits
     for (size_t i = 0; i < n_motors; i++) {
@@ -120,8 +120,8 @@ void Planner::append_block( ActuatorCoordinates &actuator_pos, uint8_t n_motors,
     float vmax_junction = minimum_planner_speed; // Set default max junction speed
 
     // if unit_vec was null then it was not a primary axis move so we skip the junction deviation stuff
-    if (unit_vec != nullptr && !THEKERNEL->conveyor->is_queue_empty()) {
-        Block *prev_block= THEKERNEL->conveyor->queue.item_ref(THEKERNEL->conveyor->queue.prev(THEKERNEL->conveyor->queue.head_i));
+    if (unit_vec != nullptr && !THECONVEYOR->is_queue_empty()) {
+        Block *prev_block= THECONVEYOR->queue.item_ref(THECONVEYOR->queue.prev(THECONVEYOR->queue.head_i));
         float previous_nominal_speed = prev_block->primary_axis ? prev_block->nominal_speed : 0;
 
         if (junction_deviation > 0.0F && previous_nominal_speed > 0.0F) {
@@ -176,12 +176,12 @@ void Planner::append_block( ActuatorCoordinates &actuator_pos, uint8_t n_motors,
     // The block can now be used
     block->ready();
 
-    THEKERNEL->conveyor->queue_head_block();
+    THECONVEYOR->queue_head_block();
 }
 
 void Planner::recalculate()
 {
-    Conveyor::Queue_t &queue = THEKERNEL->conveyor->queue;
+    Conveyor::Queue_t &queue = THECONVEYOR->queue;
 
     unsigned int block_index;