瀏覽代碼

fixed the st_synchronize. it would have continued if there is only the last move of the buffer being stepped.

Bernhard 12 年之前
父節點
當前提交
61c943b4bf
共有 2 個文件被更改,包括 15 次插入10 次删除
  1. 10
    0
      Marlin/planner.h
  2. 5
    10
      Marlin/stepper.cpp

+ 10
- 0
Marlin/planner.h 查看文件

@@ -130,4 +130,14 @@ FORCE_INLINE block_t *plan_get_current_block()
130 130
   block->busy = true;
131 131
   return(block);
132 132
 }
133
+
134
+// Gets the current block. Returns NULL if buffer empty
135
+FORCE_INLINE bool blocks_queued() 
136
+{
137
+  if (block_buffer_head == block_buffer_tail) { 
138
+    return false; 
139
+  }
140
+  else
141
+    return true;
142
+}
133 143
 #endif

+ 5
- 10
Marlin/stepper.cpp 查看文件

@@ -706,22 +706,17 @@ void st_init()
706 706
   sei();
707 707
 }
708 708
 
709
-#define TEMPORARY_Z_HOME_SOUND_FIX
710
-#ifdef TEMPORARY_Z_HOME_SOUND_FIX
711
-  #include <util/delay.h>
712
-#endif
709
+
710
+#include <util/delay.h>
713 711
 // Block until all buffered steps are executed
714 712
 void st_synchronize()
715 713
 {
716
-  while(plan_get_current_block()) {
714
+  while(current_block!=0 || blocks_queued()) {
717 715
     manage_heater();
718 716
     manage_inactivity(1);
719 717
     LCD_STATUS;
720
-    #ifdef TEMPORARY_Z_HOME_SOUND_FIX
721
-    _delay_ms(200);
722
-    _delay_ms(200);
723
-    #endif
724
-  }   
718
+    //_delay_ms(1);
719
+  }
725 720
 }
726 721
 
727 722
 void st_set_position(const long &x, const long &y, const long &z, const long &e)

Loading…
取消
儲存