|
@@ -186,7 +186,8 @@ class FilamentSensorBase {
|
186
|
186
|
old_state = new_state;
|
187
|
187
|
|
188
|
188
|
#ifdef FILAMENT_RUNOUT_SENSOR_DEBUG
|
189
|
|
- if (change) SERIAL_PROTOCOLLNPAIR("Motion detected: ", int(change));
|
|
189
|
+ for (uint8_t e = 0; e < EXTRUDERS; e++)
|
|
190
|
+ if (TEST(change, e)) SERIAL_PROTOCOLLNPAIR("Motion detected T", e);
|
190
|
191
|
#endif
|
191
|
192
|
|
192
|
193
|
motion_detected |= change;
|
|
@@ -295,9 +296,12 @@ class FilamentSensorBase {
|
295
|
296
|
}
|
296
|
297
|
|
297
|
298
|
static inline void block_completed(const block_t* const b) {
|
298
|
|
- const uint8_t e = b->extruder;
|
299
|
|
- const int32_t steps = b->steps[E_AXIS];
|
300
|
|
- runout_mm_countdown[e] -= (TEST(b->direction_bits, E_AXIS) ? -steps : steps) * planner.steps_to_mm[E_AXIS_N(e)];
|
|
299
|
+ if (b->steps[X_AXIS] || b->steps[Y_AXIS] || b->steps[Z_AXIS]) {
|
|
300
|
+ // Only trigger on extrusion with XYZ movement to allow filament change and retract/recover.
|
|
301
|
+ const uint8_t e = b->extruder;
|
|
302
|
+ const int32_t steps = b->steps[E_AXIS];
|
|
303
|
+ runout_mm_countdown[e] -= (TEST(b->direction_bits, E_AXIS) ? -steps : steps) * planner.steps_to_mm[E_AXIS_N(e)];
|
|
304
|
+ }
|
301
|
305
|
}
|
302
|
306
|
};
|
303
|
307
|
|