Ensure smooth print moves even with LCD enabled
lcd_update can take so much time that the block buffer gets drained if there are only short segments. This leads to jerky printer movements for example in circles and a bad print quality. This change implements a simple check: Only if the block currently executed is long enough, run lcd_update. This also means the printer will not show actual values on the LCD nor will it respond to buttons pressed. A option that keeps the menu accessible is also available. Aditionaly, slow down if a block would be so fast that adding a new block to the buffer would take more time. In this case, the buffer would drain until it's empty in worst case.
This commit is contained in:
committed by
Scott Lahteine
parent
0be6167f14
commit
de89dc9f04
@ -2710,15 +2710,24 @@ void lcd_update() {
|
||||
// We arrive here every ~100ms when idling often enough.
|
||||
// Instead of tracking the changes simply redraw the Info Screen ~1 time a second.
|
||||
static int8_t lcd_status_update_delay = 1; // first update one loop delayed
|
||||
if (
|
||||
#if ENABLED(ULTIPANEL)
|
||||
currentScreen == lcd_status_screen &&
|
||||
#endif
|
||||
!lcd_status_update_delay--) {
|
||||
lcd_status_update_delay = 9;
|
||||
lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
|
||||
}
|
||||
#if ENABLED(ENSURE_SMOOTH_MOVES) && ENABLED(ALWAYS_ALLOW_MENU)
|
||||
if (planner.long_move()) {
|
||||
#endif
|
||||
if (
|
||||
#if ENABLED(ULTIPANEL)
|
||||
currentScreen == lcd_status_screen &&
|
||||
#endif
|
||||
!lcd_status_update_delay--) {
|
||||
lcd_status_update_delay = 9;
|
||||
lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
|
||||
}
|
||||
#if ENABLED(ENSURE_SMOOTH_MOVES) && ENABLED(ALWAYS_ALLOW_MENU)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ENABLED(ENSURE_SMOOTH_MOVES) && DISABLED(ALWAYS_ALLOW_MENU)
|
||||
if (planner.long_move()) {
|
||||
#endif
|
||||
if (lcdDrawUpdate) {
|
||||
|
||||
switch (lcdDrawUpdate) {
|
||||
@ -2779,6 +2788,9 @@ void lcd_update() {
|
||||
break;
|
||||
}
|
||||
|
||||
#if ENABLED(ENSURE_SMOOTH_MOVES) && DISABLED(ALWAYS_ALLOW_MENU)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user