[2.0.x] Enhancements to FILAMENT_RUNOUT_SENSOR (#12069)

- Added FILAMENT_RUNOUT_DISTANCE_MM option
- Added FILAMENT_MOTION_SENSOR option
This commit is contained in:
Marcio Teixeira
2018-10-16 06:28:52 -06:00
committed by Scott Lahteine
parent cce4931342
commit 056561df93
84 changed files with 1233 additions and 90 deletions

View File

@ -83,7 +83,7 @@ enum BlockFlag : char {
* The "nominal" values are as-specified by gcode, and
* may never actually be reached due to acceleration limits.
*/
typedef struct {
typedef struct block_t {
volatile uint8_t flag; // Block flags (See BlockFlag enum above) - Modified by ISR and main thread!
@ -109,6 +109,8 @@ typedef struct {
#if EXTRUDERS > 1
uint8_t extruder; // The extruder to move (if E move)
#else
static constexpr uint8_t extruder = 0;
#endif
#if ENABLED(MIXING_EXTRUDER)

View File

@ -109,6 +109,10 @@
Stepper stepper; // Singleton
#if FILAMENT_RUNOUT_DISTANCE_MM > 0
#include "../feature/runout.h"
#endif
// public:
#if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS
@ -1473,6 +1477,9 @@ uint32_t Stepper::stepper_block_phase_isr() {
// If current block is finished, reset pointer
if (step_events_completed >= step_event_count) {
#if FILAMENT_RUNOUT_DISTANCE_MM > 0
runout.block_complete(current_block);
#endif
axis_did_move = 0;
current_block = NULL;
planner.discard_current_block();