blocks_queued => has_blocks_queued

This commit is contained in:
Scott Lahteine 2018-03-21 03:18:14 -05:00
parent 647c04def8
commit c57545ee08
4 changed files with 11 additions and 11 deletions

View File

@ -13505,7 +13505,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
#endif
if (stepper_inactive_time) {
if (planner.blocks_queued())
if (planner.has_blocks_queued())
previous_move_ms = ms; // reset_stepper_timeout to keep steppers powered
else if (MOVE_AWAY_TEST && !ignore_stepper_queue && ELAPSED(ms, previous_move_ms + stepper_inactive_time)) {
#if ENABLED(DISABLE_INACTIVE_X)
@ -13583,7 +13583,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
#if ENABLED(EXTRUDER_RUNOUT_PREVENT)
if (thermalManager.degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP
&& ELAPSED(ms, previous_move_ms + (EXTRUDER_RUNOUT_SECONDS) * 1000UL)
&& !planner.blocks_queued()
&& !planner.has_blocks_queued()
) {
#if ENABLED(SWITCHING_EXTRUDER)
const bool oldstatus = E0_ENABLE_READ;
@ -13692,7 +13692,7 @@ void idle(
#if ENABLED(I2C_POSITION_ENCODERS)
static millis_t i2cpem_next_update_ms;
if (planner.blocks_queued() && ELAPSED(millis(), i2cpem_next_update_ms)) {
if (planner.has_blocks_queued() && ELAPSED(millis(), i2cpem_next_update_ms)) {
I2CPEM.update();
i2cpem_next_update_ms = millis() + I2CPE_MIN_UPD_TIME_MS;
}

View File

@ -457,7 +457,7 @@ void Planner::check_axes_activity() {
#endif
#endif
if (blocks_queued()) {
if (has_blocks_queued()) {
#if FAN_COUNT > 0
for (uint8_t i = 0; i < FAN_COUNT; i++)
@ -1536,7 +1536,7 @@ void Planner::buffer_segment(const float &a, const float &b, const float &c, con
//*/
// Always split the first move into two (if not homing or probing)
if (!blocks_queued()) {
if (!has_blocks_queued()) {
#define _BETWEEN(A) (position[A##_AXIS] + target[A##_AXIS]) >> 1
const int32_t between[ABCE] = { _BETWEEN(A), _BETWEEN(B), _BETWEEN(C), _BETWEEN(E) };

View File

@ -508,14 +508,14 @@ class Planner {
/**
* Does the buffer have any blocks queued?
*/
static inline bool blocks_queued() { return (block_buffer_head != block_buffer_tail); }
static inline bool has_blocks_queued() { return (block_buffer_head != block_buffer_tail); }
/**
* "Discard" the block and "release" the memory.
* Called when the current block is no longer needed.
*/
FORCE_INLINE static void discard_current_block() {
if (blocks_queued())
if (has_blocks_queued())
block_buffer_tail = BLOCK_MOD(block_buffer_tail + 1);
}
@ -524,7 +524,7 @@ class Planner {
* Called after an interrupted move to throw away the rest of the move.
*/
FORCE_INLINE static bool discard_continued_block() {
const bool discard = blocks_queued() && TEST(block_buffer[block_buffer_tail].flag, BLOCK_BIT_CONTINUED);
const bool discard = has_blocks_queued() && TEST(block_buffer[block_buffer_tail].flag, BLOCK_BIT_CONTINUED);
if (discard) discard_current_block();
return discard;
}
@ -535,7 +535,7 @@ class Planner {
* WARNING: Called from Stepper ISR context!
*/
static block_t* get_current_block() {
if (blocks_queued()) {
if (has_blocks_queued()) {
block_t * const block = &block_buffer[block_buffer_tail];
// If the block has no trapezoid calculated, it's unsafe to execute.

View File

@ -1112,7 +1112,7 @@ void Stepper::init() {
/**
* Block until all buffered steps are executed / cleaned
*/
void Stepper::synchronize() { while (planner.blocks_queued() || cleaning_buffer_counter) idle(); }
void Stepper::synchronize() { while (planner.has_blocks_queued() || cleaning_buffer_counter) idle(); }
/**
* Set the stepper positions directly in steps
@ -1212,7 +1212,7 @@ void Stepper::finish_and_disable() {
void Stepper::quick_stop() {
cleaning_buffer_counter = 5000;
DISABLE_STEPPER_DRIVER_INTERRUPT();
while (planner.blocks_queued()) planner.discard_current_block();
while (planner.has_blocks_queued()) planner.discard_current_block();
current_block = NULL;
ENABLE_STEPPER_DRIVER_INTERRUPT();
#if ENABLED(ULTRA_LCD)