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

This commit is contained in:
Bernhard 2011-12-09 12:32:31 +01:00
parent 754d2d69b2
commit 61c943b4bf
2 changed files with 15 additions and 10 deletions

View file

@ -130,4 +130,14 @@ FORCE_INLINE block_t *plan_get_current_block()
block->busy = true; block->busy = true;
return(block); return(block);
} }
// Gets the current block. Returns NULL if buffer empty
FORCE_INLINE bool blocks_queued()
{
if (block_buffer_head == block_buffer_tail) {
return false;
}
else
return true;
}
#endif #endif

View file

@ -706,21 +706,16 @@ void st_init()
sei(); sei();
} }
#define TEMPORARY_Z_HOME_SOUND_FIX
#ifdef TEMPORARY_Z_HOME_SOUND_FIX #include <util/delay.h>
#include <util/delay.h>
#endif
// Block until all buffered steps are executed // Block until all buffered steps are executed
void st_synchronize() void st_synchronize()
{ {
while(plan_get_current_block()) { while(current_block!=0 || blocks_queued()) {
manage_heater(); manage_heater();
manage_inactivity(1); manage_inactivity(1);
LCD_STATUS; LCD_STATUS;
#ifdef TEMPORARY_Z_HOME_SOUND_FIX //_delay_ms(1);
_delay_ms(200);
_delay_ms(200);
#endif
} }
} }