Browse Source

Improve runout sensor, fix LIGHTWEIGHT_UI screen size (#12544)

Marcio Teixeira 5 years ago
parent
commit
439a3e8463
2 changed files with 10 additions and 10 deletions
  1. 8
    4
      Marlin/src/feature/runout.h
  2. 2
    6
      Marlin/src/inc/Conditionals_post.h

+ 8
- 4
Marlin/src/feature/runout.h View File

186
         old_state = new_state;
186
         old_state = new_state;
187
 
187
 
188
         #ifdef FILAMENT_RUNOUT_SENSOR_DEBUG
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
         #endif
191
         #endif
191
 
192
 
192
         motion_detected |= change;
193
         motion_detected |= change;
295
       }
296
       }
296
 
297
 
297
       static inline void block_completed(const block_t* const b) {
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
 

+ 2
- 6
Marlin/src/inc/Conditionals_post.h View File

1641
 
1641
 
1642
 // Get LCD character width/height, which may be overridden by pins, configs, etc.
1642
 // Get LCD character width/height, which may be overridden by pins, configs, etc.
1643
 #ifndef LCD_WIDTH
1643
 #ifndef LCD_WIDTH
1644
-  #if ENABLED(LIGHTWEIGHT_UI)
1645
-    #define LCD_WIDTH 16
1646
-  #elif HAS_GRAPHICAL_LCD
1644
+  #if HAS_GRAPHICAL_LCD
1647
     #define LCD_WIDTH 22
1645
     #define LCD_WIDTH 22
1648
   #elif ENABLED(ULTIPANEL)
1646
   #elif ENABLED(ULTIPANEL)
1649
     #define LCD_WIDTH 20
1647
     #define LCD_WIDTH 20
1652
   #endif
1650
   #endif
1653
 #endif
1651
 #endif
1654
 #ifndef LCD_HEIGHT
1652
 #ifndef LCD_HEIGHT
1655
-  #if ENABLED(LIGHTWEIGHT_UI)
1656
-    #define LCD_HEIGHT 4
1657
-  #elif HAS_GRAPHICAL_LCD
1653
+  #if HAS_GRAPHICAL_LCD
1658
     #define LCD_HEIGHT 5
1654
     #define LCD_HEIGHT 5
1659
   #elif ENABLED(ULTIPANEL)
1655
   #elif ENABLED(ULTIPANEL)
1660
     #define LCD_HEIGHT 4
1656
     #define LCD_HEIGHT 4

Loading…
Cancel
Save