Browse Source

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

Bernhard 13 years ago
parent
commit
61c943b4bf
2 changed files with 15 additions and 10 deletions
  1. 10
    0
      Marlin/planner.h
  2. 5
    10
      Marlin/stepper.cpp

+ 10
- 0
Marlin/planner.h View File

130
   block->busy = true;
130
   block->busy = true;
131
   return(block);
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
 #endif
143
 #endif

+ 5
- 10
Marlin/stepper.cpp View File

706
   sei();
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
 // Block until all buffered steps are executed
711
 // Block until all buffered steps are executed
714
 void st_synchronize()
712
 void st_synchronize()
715
 {
713
 {
716
-  while(plan_get_current_block()) {
714
+  while(current_block!=0 || blocks_queued()) {
717
     manage_heater();
715
     manage_heater();
718
     manage_inactivity(1);
716
     manage_inactivity(1);
719
     LCD_STATUS;
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
 void st_set_position(const long &x, const long &y, const long &z, const long &e)
722
 void st_set_position(const long &x, const long &y, const long &z, const long &e)

Loading…
Cancel
Save