0
0
Fork 0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2025-06-30 02:40:57 +00:00

[2.0.x] Automatically reset stepper timeout ()

* Automatically reset stepper timeout in manage_inactivity

Any code that adds moves to the planner can skip resetting the stepper timeout. We can let `idle` / `manage_inactivity` reset the timer whenever it detects any moves in the planner.

* blocks_queued => has_blocks_queued
This commit is contained in:
Scott Lahteine 2018-03-21 19:30:06 -05:00 committed by GitHub
parent 97e8a6ebd9
commit 1cb810ff1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 47 additions and 62 deletions
Marlin/src/module

View file

@ -1091,7 +1091,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
@ -1191,7 +1191,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)