瀏覽代碼

Adaptive screen updates for all kinds of displays

The target here is to update the screens of graphical and char base
displays as fast as possible, without draining the planner buffer too much.

For that measure the time it takes to draw and transfer one
(partial) screen to the display. Build a max. value from that.
Because ther can be large differences, depending on how much the display
updates are interrupted, the max value is decreased by one ms/s. This way
it can shrink again.
On the other side we keep track on how much time it takes to empty the
planner buffer.
Now we draw the next (partial) display update only then, when we do not
drain the planner buffer to much. We draw only when the time in the
buffer is two times larger than a update takes, or the buffer is empty anyway.

When we have begun to draw a screen we do not wait until the next 100ms
time slot comes. We draw the next partial screen as fast as possible, but
give the system a chance to refill the buffers a bit.

When we see, during drawing a screen, the screen contend has changed,
we stop the current draw and begin to draw the new content from the top.
AnHardt 7 年之前
父節點
當前提交
d0e24e0876

+ 0
- 30
Marlin/Configuration_adv.h 查看文件

@@ -507,36 +507,6 @@
507 507
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
508 508
 #endif
509 509
 
510
-//
511
-// Ensure Smooth Moves
512
-//
513
-// Enable this option to prevent the machine from stuttering when printing multiple short segments.
514
-// This feature uses two strategies to eliminate stuttering:
515
-//
516
-// 1. During short segments a Graphical LCD update may take so much time that the planner buffer gets
517
-//    completely drained. When this happens pauses are introduced between short segments, and print moves
518
-//    will become jerky until a longer segment provides enough time for the buffer to be filled again.
519
-//    This jerkiness negatively affects print quality. The ENSURE_SMOOTH_MOVES option addresses the issue
520
-//    by pausing the LCD until there's enough time to safely update.
521
-//
522
-//    NOTE: This will cause the Info Screen to lag and controller buttons may become unresponsive.
523
-//          Enable ALWAYS_ALLOW_MENU to keep the controller responsive.
524
-//
525
-// 2. No block is allowed to take less time than MIN_BLOCK_TIME. That's the time it takes in the main
526
-//    loop to add a new block to the buffer, check temperatures, etc., including all blocked time due to
527
-//    interrupts (without LCD update). By enforcing a minimum time-per-move, the buffer is prevented from
528
-//    draining.
529
-//
530
-//#define ENSURE_SMOOTH_MOVES
531
-#if ENABLED(ENSURE_SMOOTH_MOVES)
532
-  //#define ALWAYS_ALLOW_MENU      // If enabled, the menu will always be responsive.
533
-                                   // WARNING: Menu navigation during short moves may cause stuttering!
534
-  #define LCD_UPDATE_THRESHOLD 135 // (ms) Minimum duration for the current segment to allow an LCD update.
535
-                                   // Default value is good for graphical LCDs (e.g., REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER).
536
-                                   // You may try to lower this value until you printer starts stuttering again as if ENSURE_SMOOTH_MOVES is disabled.
537
-  #define MIN_BLOCK_TIME 6         // (ms) Minimum duration of a single block. You shouldn't need to modify this.
538
-#endif
539
-
540 510
 // @section extruder
541 511
 
542 512
 // extruder advance constant (s2/mm3)

+ 2
- 2
Marlin/Marlin_main.cpp 查看文件

@@ -760,8 +760,8 @@ inline void sync_plan_position_e() { planner.set_e_position_mm(current_position[
760 760
   int freeMemory() { return SdFatUtil::FreeRam(); }
761 761
 #else
762 762
 extern "C" {
763
-  extern unsigned int __bss_end;
764
-  extern unsigned int __heap_start;
763
+  extern char __bss_end;
764
+  extern char __heap_start;
765 765
   extern void* __brkval;
766 766
 
767 767
   int freeMemory() {

+ 0
- 30
Marlin/example_configurations/Cartesio/Configuration_adv.h 查看文件

@@ -507,36 +507,6 @@
507 507
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
508 508
 #endif
509 509
 
510
-//
511
-// Ensure Smooth Moves
512
-//
513
-// Enable this option to prevent the machine from stuttering when printing multiple short segments.
514
-// This feature uses two strategies to eliminate stuttering:
515
-//
516
-// 1. During short segments a Graphical LCD update may take so much time that the planner buffer gets
517
-//    completely drained. When this happens pauses are introduced between short segments, and print moves
518
-//    will become jerky until a longer segment provides enough time for the buffer to be filled again.
519
-//    This jerkiness negatively affects print quality. The ENSURE_SMOOTH_MOVES option addresses the issue
520
-//    by pausing the LCD until there's enough time to safely update.
521
-//
522
-//    NOTE: This will cause the Info Screen to lag and controller buttons may become unresponsive.
523
-//          Enable ALWAYS_ALLOW_MENU to keep the controller responsive.
524
-//
525
-// 2. No block is allowed to take less time than MIN_BLOCK_TIME. That's the time it takes in the main
526
-//    loop to add a new block to the buffer, check temperatures, etc., including all blocked time due to
527
-//    interrupts (without LCD update). By enforcing a minimum time-per-move, the buffer is prevented from
528
-//    draining.
529
-//
530
-//#define ENSURE_SMOOTH_MOVES
531
-#if ENABLED(ENSURE_SMOOTH_MOVES)
532
-  //#define ALWAYS_ALLOW_MENU      // If enabled, the menu will always be responsive.
533
-                                   // WARNING: Menu navigation during short moves may cause stuttering!
534
-  #define LCD_UPDATE_THRESHOLD 135 // (ms) Minimum duration for the current segment to allow an LCD update.
535
-                                   // Default value is good for graphical LCDs (e.g., REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER).
536
-                                   // You may try to lower this value until you printer starts stuttering again as if ENSURE_SMOOTH_MOVES is disabled.
537
-  #define MIN_BLOCK_TIME 6         // (ms) Minimum duration of a single block. You shouldn't need to modify this.
538
-#endif
539
-
540 510
 // @section extruder
541 511
 
542 512
 // extruder advance constant (s2/mm3)

+ 0
- 30
Marlin/example_configurations/Felix/Configuration_adv.h 查看文件

@@ -507,36 +507,6 @@
507 507
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
508 508
 #endif
509 509
 
510
-//
511
-// Ensure Smooth Moves
512
-//
513
-// Enable this option to prevent the machine from stuttering when printing multiple short segments.
514
-// This feature uses two strategies to eliminate stuttering:
515
-//
516
-// 1. During short segments a Graphical LCD update may take so much time that the planner buffer gets
517
-//    completely drained. When this happens pauses are introduced between short segments, and print moves
518
-//    will become jerky until a longer segment provides enough time for the buffer to be filled again.
519
-//    This jerkiness negatively affects print quality. The ENSURE_SMOOTH_MOVES option addresses the issue
520
-//    by pausing the LCD until there's enough time to safely update.
521
-//
522
-//    NOTE: This will cause the Info Screen to lag and controller buttons may become unresponsive.
523
-//          Enable ALWAYS_ALLOW_MENU to keep the controller responsive.
524
-//
525
-// 2. No block is allowed to take less time than MIN_BLOCK_TIME. That's the time it takes in the main
526
-//    loop to add a new block to the buffer, check temperatures, etc., including all blocked time due to
527
-//    interrupts (without LCD update). By enforcing a minimum time-per-move, the buffer is prevented from
528
-//    draining.
529
-//
530
-//#define ENSURE_SMOOTH_MOVES
531
-#if ENABLED(ENSURE_SMOOTH_MOVES)
532
-  //#define ALWAYS_ALLOW_MENU      // If enabled, the menu will always be responsive.
533
-                                   // WARNING: Menu navigation during short moves may cause stuttering!
534
-  #define LCD_UPDATE_THRESHOLD 135 // (ms) Minimum duration for the current segment to allow an LCD update.
535
-                                   // Default value is good for graphical LCDs (e.g., REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER).
536
-                                   // You may try to lower this value until you printer starts stuttering again as if ENSURE_SMOOTH_MOVES is disabled.
537
-  #define MIN_BLOCK_TIME 6         // (ms) Minimum duration of a single block. You shouldn't need to modify this.
538
-#endif
539
-
540 510
 // @section extruder
541 511
 
542 512
 // extruder advance constant (s2/mm3)

+ 0
- 30
Marlin/example_configurations/Hephestos/Configuration_adv.h 查看文件

@@ -507,36 +507,6 @@
507 507
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
508 508
 #endif
509 509
 
510
-//
511
-// Ensure Smooth Moves
512
-//
513
-// Enable this option to prevent the machine from stuttering when printing multiple short segments.
514
-// This feature uses two strategies to eliminate stuttering:
515
-//
516
-// 1. During short segments a Graphical LCD update may take so much time that the planner buffer gets
517
-//    completely drained. When this happens pauses are introduced between short segments, and print moves
518
-//    will become jerky until a longer segment provides enough time for the buffer to be filled again.
519
-//    This jerkiness negatively affects print quality. The ENSURE_SMOOTH_MOVES option addresses the issue
520
-//    by pausing the LCD until there's enough time to safely update.
521
-//
522
-//    NOTE: This will cause the Info Screen to lag and controller buttons may become unresponsive.
523
-//          Enable ALWAYS_ALLOW_MENU to keep the controller responsive.
524
-//
525
-// 2. No block is allowed to take less time than MIN_BLOCK_TIME. That's the time it takes in the main
526
-//    loop to add a new block to the buffer, check temperatures, etc., including all blocked time due to
527
-//    interrupts (without LCD update). By enforcing a minimum time-per-move, the buffer is prevented from
528
-//    draining.
529
-//
530
-//#define ENSURE_SMOOTH_MOVES
531
-#if ENABLED(ENSURE_SMOOTH_MOVES)
532
-  //#define ALWAYS_ALLOW_MENU      // If enabled, the menu will always be responsive.
533
-                                   // WARNING: Menu navigation during short moves may cause stuttering!
534
-  #define LCD_UPDATE_THRESHOLD 135 // (ms) Minimum duration for the current segment to allow an LCD update.
535
-                                   // Default value is good for graphical LCDs (e.g., REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER).
536
-                                   // You may try to lower this value until you printer starts stuttering again as if ENSURE_SMOOTH_MOVES is disabled.
537
-  #define MIN_BLOCK_TIME 6         // (ms) Minimum duration of a single block. You shouldn't need to modify this.
538
-#endif
539
-
540 510
 // @section extruder
541 511
 
542 512
 // extruder advance constant (s2/mm3)

+ 0
- 30
Marlin/example_configurations/Hephestos_2/Configuration_adv.h 查看文件

@@ -507,36 +507,6 @@
507 507
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
508 508
 #endif
509 509
 
510
-//
511
-// Ensure Smooth Moves
512
-//
513
-// Enable this option to prevent the machine from stuttering when printing multiple short segments.
514
-// This feature uses two strategies to eliminate stuttering:
515
-//
516
-// 1. During short segments a Graphical LCD update may take so much time that the planner buffer gets
517
-//    completely drained. When this happens pauses are introduced between short segments, and print moves
518
-//    will become jerky until a longer segment provides enough time for the buffer to be filled again.
519
-//    This jerkiness negatively affects print quality. The ENSURE_SMOOTH_MOVES option addresses the issue
520
-//    by pausing the LCD until there's enough time to safely update.
521
-//
522
-//    NOTE: This will cause the Info Screen to lag and controller buttons may become unresponsive.
523
-//          Enable ALWAYS_ALLOW_MENU to keep the controller responsive.
524
-//
525
-// 2. No block is allowed to take less time than MIN_BLOCK_TIME. That's the time it takes in the main
526
-//    loop to add a new block to the buffer, check temperatures, etc., including all blocked time due to
527
-//    interrupts (without LCD update). By enforcing a minimum time-per-move, the buffer is prevented from
528
-//    draining.
529
-//
530
-#define ENSURE_SMOOTH_MOVES
531
-#if ENABLED(ENSURE_SMOOTH_MOVES)
532
-  //#define ALWAYS_ALLOW_MENU      // If enabled, the menu will always be responsive.
533
-                                   // WARNING: Menu navigation during short moves may cause stuttering!
534
-  #define LCD_UPDATE_THRESHOLD 135 // (ms) Minimum duration for the current segment to allow an LCD update.
535
-                                   // Default value is good for graphical LCDs (e.g., REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER).
536
-                                   // You may try to lower this value until you printer starts stuttering again as if ENSURE_SMOOTH_MOVES is disabled.
537
-  #define MIN_BLOCK_TIME 6         // (ms) Minimum duration of a single block. You shouldn't need to modify this.
538
-#endif
539
-
540 510
 // @section extruder
541 511
 
542 512
 // extruder advance constant (s2/mm3)

+ 0
- 30
Marlin/example_configurations/K8200/Configuration_adv.h 查看文件

@@ -520,36 +520,6 @@
520 520
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
521 521
 #endif
522 522
 
523
-//
524
-// Ensure Smooth Moves
525
-//
526
-// Enable this option to prevent the machine from stuttering when printing multiple short segments.
527
-// This feature uses two strategies to eliminate stuttering:
528
-//
529
-// 1. During short segments a Graphical LCD update may take so much time that the planner buffer gets
530
-//    completely drained. When this happens pauses are introduced between short segments, and print moves
531
-//    will become jerky until a longer segment provides enough time for the buffer to be filled again.
532
-//    This jerkiness negatively affects print quality. The ENSURE_SMOOTH_MOVES option addresses the issue
533
-//    by pausing the LCD until there's enough time to safely update.
534
-//
535
-//    NOTE: This will cause the Info Screen to lag and controller buttons may become unresponsive.
536
-//          Enable ALWAYS_ALLOW_MENU to keep the controller responsive.
537
-//
538
-// 2. No block is allowed to take less time than MIN_BLOCK_TIME. That's the time it takes in the main
539
-//    loop to add a new block to the buffer, check temperatures, etc., including all blocked time due to
540
-//    interrupts (without LCD update). By enforcing a minimum time-per-move, the buffer is prevented from
541
-//    draining.
542
-//
543
-//#define ENSURE_SMOOTH_MOVES
544
-#if ENABLED(ENSURE_SMOOTH_MOVES)
545
-  //#define ALWAYS_ALLOW_MENU      // If enabled, the menu will always be responsive.
546
-                                   // WARNING: Menu navigation during short moves may cause stuttering!
547
-  #define LCD_UPDATE_THRESHOLD 135 // (ms) Minimum duration for the current segment to allow an LCD update.
548
-                                   // Default value is good for graphical LCDs (e.g., REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER).
549
-                                   // You may try to lower this value until you printer starts stuttering again as if ENSURE_SMOOTH_MOVES is disabled.
550
-  #define MIN_BLOCK_TIME 6         // (ms) Minimum duration of a single block. You shouldn't need to modify this.
551
-#endif
552
-
553 523
 // @section extruder
554 524
 
555 525
 // extruder advance constant (s2/mm3)

+ 0
- 30
Marlin/example_configurations/K8400/Configuration_adv.h 查看文件

@@ -507,36 +507,6 @@
507 507
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
508 508
 #endif
509 509
 
510
-//
511
-// Ensure Smooth Moves
512
-//
513
-// Enable this option to prevent the machine from stuttering when printing multiple short segments.
514
-// This feature uses two strategies to eliminate stuttering:
515
-//
516
-// 1. During short segments a Graphical LCD update may take so much time that the planner buffer gets
517
-//    completely drained. When this happens pauses are introduced between short segments, and print moves
518
-//    will become jerky until a longer segment provides enough time for the buffer to be filled again.
519
-//    This jerkiness negatively affects print quality. The ENSURE_SMOOTH_MOVES option addresses the issue
520
-//    by pausing the LCD until there's enough time to safely update.
521
-//
522
-//    NOTE: This will cause the Info Screen to lag and controller buttons may become unresponsive.
523
-//          Enable ALWAYS_ALLOW_MENU to keep the controller responsive.
524
-//
525
-// 2. No block is allowed to take less time than MIN_BLOCK_TIME. That's the time it takes in the main
526
-//    loop to add a new block to the buffer, check temperatures, etc., including all blocked time due to
527
-//    interrupts (without LCD update). By enforcing a minimum time-per-move, the buffer is prevented from
528
-//    draining.
529
-//
530
-//#define ENSURE_SMOOTH_MOVES
531
-#if ENABLED(ENSURE_SMOOTH_MOVES)
532
-  //#define ALWAYS_ALLOW_MENU      // If enabled, the menu will always be responsive.
533
-                                   // WARNING: Menu navigation during short moves may cause stuttering!
534
-  #define LCD_UPDATE_THRESHOLD 135 // (ms) Minimum duration for the current segment to allow an LCD update.
535
-                                   // Default value is good for graphical LCDs (e.g., REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER).
536
-                                   // You may try to lower this value until you printer starts stuttering again as if ENSURE_SMOOTH_MOVES is disabled.
537
-  #define MIN_BLOCK_TIME 6         // (ms) Minimum duration of a single block. You shouldn't need to modify this.
538
-#endif
539
-
540 510
 // @section extruder
541 511
 
542 512
 // extruder advance constant (s2/mm3)

+ 0
- 30
Marlin/example_configurations/RigidBot/Configuration_adv.h 查看文件

@@ -507,36 +507,6 @@
507 507
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
508 508
 #endif
509 509
 
510
-//
511
-// Ensure Smooth Moves
512
-//
513
-// Enable this option to prevent the machine from stuttering when printing multiple short segments.
514
-// This feature uses two strategies to eliminate stuttering:
515
-//
516
-// 1. During short segments a Graphical LCD update may take so much time that the planner buffer gets
517
-//    completely drained. When this happens pauses are introduced between short segments, and print moves
518
-//    will become jerky until a longer segment provides enough time for the buffer to be filled again.
519
-//    This jerkiness negatively affects print quality. The ENSURE_SMOOTH_MOVES option addresses the issue
520
-//    by pausing the LCD until there's enough time to safely update.
521
-//
522
-//    NOTE: This will cause the Info Screen to lag and controller buttons may become unresponsive.
523
-//          Enable ALWAYS_ALLOW_MENU to keep the controller responsive.
524
-//
525
-// 2. No block is allowed to take less time than MIN_BLOCK_TIME. That's the time it takes in the main
526
-//    loop to add a new block to the buffer, check temperatures, etc., including all blocked time due to
527
-//    interrupts (without LCD update). By enforcing a minimum time-per-move, the buffer is prevented from
528
-//    draining.
529
-//
530
-//#define ENSURE_SMOOTH_MOVES
531
-#if ENABLED(ENSURE_SMOOTH_MOVES)
532
-  //#define ALWAYS_ALLOW_MENU      // If enabled, the menu will always be responsive.
533
-                                   // WARNING: Menu navigation during short moves may cause stuttering!
534
-  #define LCD_UPDATE_THRESHOLD 135 // (ms) Minimum duration for the current segment to allow an LCD update.
535
-                                   // Default value is good for graphical LCDs (e.g., REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER).
536
-                                   // You may try to lower this value until you printer starts stuttering again as if ENSURE_SMOOTH_MOVES is disabled.
537
-  #define MIN_BLOCK_TIME 6         // (ms) Minimum duration of a single block. You shouldn't need to modify this.
538
-#endif
539
-
540 510
 // @section extruder
541 511
 
542 512
 // extruder advance constant (s2/mm3)

+ 0
- 30
Marlin/example_configurations/SCARA/Configuration_adv.h 查看文件

@@ -507,36 +507,6 @@
507 507
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
508 508
 #endif
509 509
 
510
-//
511
-// Ensure Smooth Moves
512
-//
513
-// Enable this option to prevent the machine from stuttering when printing multiple short segments.
514
-// This feature uses two strategies to eliminate stuttering:
515
-//
516
-// 1. During short segments a Graphical LCD update may take so much time that the planner buffer gets
517
-//    completely drained. When this happens pauses are introduced between short segments, and print moves
518
-//    will become jerky until a longer segment provides enough time for the buffer to be filled again.
519
-//    This jerkiness negatively affects print quality. The ENSURE_SMOOTH_MOVES option addresses the issue
520
-//    by pausing the LCD until there's enough time to safely update.
521
-//
522
-//    NOTE: This will cause the Info Screen to lag and controller buttons may become unresponsive.
523
-//          Enable ALWAYS_ALLOW_MENU to keep the controller responsive.
524
-//
525
-// 2. No block is allowed to take less time than MIN_BLOCK_TIME. That's the time it takes in the main
526
-//    loop to add a new block to the buffer, check temperatures, etc., including all blocked time due to
527
-//    interrupts (without LCD update). By enforcing a minimum time-per-move, the buffer is prevented from
528
-//    draining.
529
-//
530
-//#define ENSURE_SMOOTH_MOVES
531
-#if ENABLED(ENSURE_SMOOTH_MOVES)
532
-  //#define ALWAYS_ALLOW_MENU      // If enabled, the menu will always be responsive.
533
-                                   // WARNING: Menu navigation during short moves may cause stuttering!
534
-  #define LCD_UPDATE_THRESHOLD 135 // (ms) Minimum duration for the current segment to allow an LCD update.
535
-                                   // Default value is good for graphical LCDs (e.g., REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER).
536
-                                   // You may try to lower this value until you printer starts stuttering again as if ENSURE_SMOOTH_MOVES is disabled.
537
-  #define MIN_BLOCK_TIME 6         // (ms) Minimum duration of a single block. You shouldn't need to modify this.
538
-#endif
539
-
540 510
 // @section extruder
541 511
 
542 512
 // extruder advance constant (s2/mm3)

+ 0
- 30
Marlin/example_configurations/TAZ4/Configuration_adv.h 查看文件

@@ -515,36 +515,6 @@
515 515
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
516 516
 #endif
517 517
 
518
-//
519
-// Ensure Smooth Moves
520
-//
521
-// Enable this option to prevent the machine from stuttering when printing multiple short segments.
522
-// This feature uses two strategies to eliminate stuttering:
523
-//
524
-// 1. During short segments a Graphical LCD update may take so much time that the planner buffer gets
525
-//    completely drained. When this happens pauses are introduced between short segments, and print moves
526
-//    will become jerky until a longer segment provides enough time for the buffer to be filled again.
527
-//    This jerkiness negatively affects print quality. The ENSURE_SMOOTH_MOVES option addresses the issue
528
-//    by pausing the LCD until there's enough time to safely update.
529
-//
530
-//    NOTE: This will cause the Info Screen to lag and controller buttons may become unresponsive.
531
-//          Enable ALWAYS_ALLOW_MENU to keep the controller responsive.
532
-//
533
-// 2. No block is allowed to take less time than MIN_BLOCK_TIME. That's the time it takes in the main
534
-//    loop to add a new block to the buffer, check temperatures, etc., including all blocked time due to
535
-//    interrupts (without LCD update). By enforcing a minimum time-per-move, the buffer is prevented from
536
-//    draining.
537
-//
538
-//#define ENSURE_SMOOTH_MOVES
539
-#if ENABLED(ENSURE_SMOOTH_MOVES)
540
-  //#define ALWAYS_ALLOW_MENU      // If enabled, the menu will always be responsive.
541
-                                   // WARNING: Menu navigation during short moves may cause stuttering!
542
-  #define LCD_UPDATE_THRESHOLD 135 // (ms) Minimum duration for the current segment to allow an LCD update.
543
-                                   // Default value is good for graphical LCDs (e.g., REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER).
544
-                                   // You may try to lower this value until you printer starts stuttering again as if ENSURE_SMOOTH_MOVES is disabled.
545
-  #define MIN_BLOCK_TIME 6         // (ms) Minimum duration of a single block. You shouldn't need to modify this.
546
-#endif
547
-
548 518
 // @section extruder
549 519
 
550 520
 // extruder advance constant (s2/mm3)

+ 0
- 30
Marlin/example_configurations/WITBOX/Configuration_adv.h 查看文件

@@ -507,36 +507,6 @@
507 507
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
508 508
 #endif
509 509
 
510
-//
511
-// Ensure Smooth Moves
512
-//
513
-// Enable this option to prevent the machine from stuttering when printing multiple short segments.
514
-// This feature uses two strategies to eliminate stuttering:
515
-//
516
-// 1. During short segments a Graphical LCD update may take so much time that the planner buffer gets
517
-//    completely drained. When this happens pauses are introduced between short segments, and print moves
518
-//    will become jerky until a longer segment provides enough time for the buffer to be filled again.
519
-//    This jerkiness negatively affects print quality. The ENSURE_SMOOTH_MOVES option addresses the issue
520
-//    by pausing the LCD until there's enough time to safely update.
521
-//
522
-//    NOTE: This will cause the Info Screen to lag and controller buttons may become unresponsive.
523
-//          Enable ALWAYS_ALLOW_MENU to keep the controller responsive.
524
-//
525
-// 2. No block is allowed to take less time than MIN_BLOCK_TIME. That's the time it takes in the main
526
-//    loop to add a new block to the buffer, check temperatures, etc., including all blocked time due to
527
-//    interrupts (without LCD update). By enforcing a minimum time-per-move, the buffer is prevented from
528
-//    draining.
529
-//
530
-//#define ENSURE_SMOOTH_MOVES
531
-#if ENABLED(ENSURE_SMOOTH_MOVES)
532
-  //#define ALWAYS_ALLOW_MENU      // If enabled, the menu will always be responsive.
533
-                                   // WARNING: Menu navigation during short moves may cause stuttering!
534
-  #define LCD_UPDATE_THRESHOLD 135 // (ms) Minimum duration for the current segment to allow an LCD update.
535
-                                   // Default value is good for graphical LCDs (e.g., REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER).
536
-                                   // You may try to lower this value until you printer starts stuttering again as if ENSURE_SMOOTH_MOVES is disabled.
537
-  #define MIN_BLOCK_TIME 6         // (ms) Minimum duration of a single block. You shouldn't need to modify this.
538
-#endif
539
-
540 510
 // @section extruder
541 511
 
542 512
 // extruder advance constant (s2/mm3)

+ 0
- 30
Marlin/example_configurations/delta/biv2.5/Configuration_adv.h 查看文件

@@ -509,36 +509,6 @@
509 509
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
510 510
 #endif
511 511
 
512
-//
513
-// Ensure Smooth Moves
514
-//
515
-// Enable this option to prevent the machine from stuttering when printing multiple short segments.
516
-// This feature uses two strategies to eliminate stuttering:
517
-//
518
-// 1. During short segments a Graphical LCD update may take so much time that the planner buffer gets
519
-//    completely drained. When this happens pauses are introduced between short segments, and print moves
520
-//    will become jerky until a longer segment provides enough time for the buffer to be filled again.
521
-//    This jerkiness negatively affects print quality. The ENSURE_SMOOTH_MOVES option addresses the issue
522
-//    by pausing the LCD until there's enough time to safely update.
523
-//
524
-//    NOTE: This will cause the Info Screen to lag and controller buttons may become unresponsive.
525
-//          Enable ALWAYS_ALLOW_MENU to keep the controller responsive.
526
-//
527
-// 2. No block is allowed to take less time than MIN_BLOCK_TIME. That's the time it takes in the main
528
-//    loop to add a new block to the buffer, check temperatures, etc., including all blocked time due to
529
-//    interrupts (without LCD update). By enforcing a minimum time-per-move, the buffer is prevented from
530
-//    draining.
531
-//
532
-//#define ENSURE_SMOOTH_MOVES
533
-#if ENABLED(ENSURE_SMOOTH_MOVES)
534
-  //#define ALWAYS_ALLOW_MENU      // If enabled, the menu will always be responsive.
535
-                                   // WARNING: Menu navigation during short moves may cause stuttering!
536
-  #define LCD_UPDATE_THRESHOLD 135 // (ms) Minimum duration for the current segment to allow an LCD update.
537
-                                   // Default value is good for graphical LCDs (e.g., REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER).
538
-                                   // You may try to lower this value until you printer starts stuttering again as if ENSURE_SMOOTH_MOVES is disabled.
539
-  #define MIN_BLOCK_TIME 6         // (ms) Minimum duration of a single block. You shouldn't need to modify this.
540
-#endif
541
-
542 512
 // @section extruder
543 513
 
544 514
 // extruder advance constant (s2/mm3)

+ 0
- 30
Marlin/example_configurations/delta/generic/Configuration_adv.h 查看文件

@@ -509,36 +509,6 @@
509 509
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
510 510
 #endif
511 511
 
512
-//
513
-// Ensure Smooth Moves
514
-//
515
-// Enable this option to prevent the machine from stuttering when printing multiple short segments.
516
-// This feature uses two strategies to eliminate stuttering:
517
-//
518
-// 1. During short segments a Graphical LCD update may take so much time that the planner buffer gets
519
-//    completely drained. When this happens pauses are introduced between short segments, and print moves
520
-//    will become jerky until a longer segment provides enough time for the buffer to be filled again.
521
-//    This jerkiness negatively affects print quality. The ENSURE_SMOOTH_MOVES option addresses the issue
522
-//    by pausing the LCD until there's enough time to safely update.
523
-//
524
-//    NOTE: This will cause the Info Screen to lag and controller buttons may become unresponsive.
525
-//          Enable ALWAYS_ALLOW_MENU to keep the controller responsive.
526
-//
527
-// 2. No block is allowed to take less time than MIN_BLOCK_TIME. That's the time it takes in the main
528
-//    loop to add a new block to the buffer, check temperatures, etc., including all blocked time due to
529
-//    interrupts (without LCD update). By enforcing a minimum time-per-move, the buffer is prevented from
530
-//    draining.
531
-//
532
-//#define ENSURE_SMOOTH_MOVES
533
-#if ENABLED(ENSURE_SMOOTH_MOVES)
534
-  //#define ALWAYS_ALLOW_MENU      // If enabled, the menu will always be responsive.
535
-                                   // WARNING: Menu navigation during short moves may cause stuttering!
536
-  #define LCD_UPDATE_THRESHOLD 135 // (ms) Minimum duration for the current segment to allow an LCD update.
537
-                                   // Default value is good for graphical LCDs (e.g., REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER).
538
-                                   // You may try to lower this value until you printer starts stuttering again as if ENSURE_SMOOTH_MOVES is disabled.
539
-  #define MIN_BLOCK_TIME 6         // (ms) Minimum duration of a single block. You shouldn't need to modify this.
540
-#endif
541
-
542 512
 // @section extruder
543 513
 
544 514
 // extruder advance constant (s2/mm3)

+ 0
- 30
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h 查看文件

@@ -509,36 +509,6 @@
509 509
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
510 510
 #endif
511 511
 
512
-//
513
-// Ensure Smooth Moves
514
-//
515
-// Enable this option to prevent the machine from stuttering when printing multiple short segments.
516
-// This feature uses two strategies to eliminate stuttering:
517
-//
518
-// 1. During short segments a Graphical LCD update may take so much time that the planner buffer gets
519
-//    completely drained. When this happens pauses are introduced between short segments, and print moves
520
-//    will become jerky until a longer segment provides enough time for the buffer to be filled again.
521
-//    This jerkiness negatively affects print quality. The ENSURE_SMOOTH_MOVES option addresses the issue
522
-//    by pausing the LCD until there's enough time to safely update.
523
-//
524
-//    NOTE: This will cause the Info Screen to lag and controller buttons may become unresponsive.
525
-//          Enable ALWAYS_ALLOW_MENU to keep the controller responsive.
526
-//
527
-// 2. No block is allowed to take less time than MIN_BLOCK_TIME. That's the time it takes in the main
528
-//    loop to add a new block to the buffer, check temperatures, etc., including all blocked time due to
529
-//    interrupts (without LCD update). By enforcing a minimum time-per-move, the buffer is prevented from
530
-//    draining.
531
-//
532
-//#define ENSURE_SMOOTH_MOVES
533
-#if ENABLED(ENSURE_SMOOTH_MOVES)
534
-  //#define ALWAYS_ALLOW_MENU      // If enabled, the menu will always be responsive.
535
-                                   // WARNING: Menu navigation during short moves may cause stuttering!
536
-  #define LCD_UPDATE_THRESHOLD 135 // (ms) Minimum duration for the current segment to allow an LCD update.
537
-                                   // Default value is good for graphical LCDs (e.g., REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER).
538
-                                   // You may try to lower this value until you printer starts stuttering again as if ENSURE_SMOOTH_MOVES is disabled.
539
-  #define MIN_BLOCK_TIME 6         // (ms) Minimum duration of a single block. You shouldn't need to modify this.
540
-#endif
541
-
542 512
 // @section extruder
543 513
 
544 514
 // extruder advance constant (s2/mm3)

+ 0
- 30
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h 查看文件

@@ -514,36 +514,6 @@
514 514
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
515 515
 #endif
516 516
 
517
-//
518
-// Ensure Smooth Moves
519
-//
520
-// Enable this option to prevent the machine from stuttering when printing multiple short segments.
521
-// This feature uses two strategies to eliminate stuttering:
522
-//
523
-// 1. During short segments a Graphical LCD update may take so much time that the planner buffer gets
524
-//    completely drained. When this happens pauses are introduced between short segments, and print moves
525
-//    will become jerky until a longer segment provides enough time for the buffer to be filled again.
526
-//    This jerkiness negatively affects print quality. The ENSURE_SMOOTH_MOVES option addresses the issue
527
-//    by pausing the LCD until there's enough time to safely update.
528
-//
529
-//    NOTE: This will cause the Info Screen to lag and controller buttons may become unresponsive.
530
-//          Enable ALWAYS_ALLOW_MENU to keep the controller responsive.
531
-//
532
-// 2. No block is allowed to take less time than MIN_BLOCK_TIME. That's the time it takes in the main
533
-//    loop to add a new block to the buffer, check temperatures, etc., including all blocked time due to
534
-//    interrupts (without LCD update). By enforcing a minimum time-per-move, the buffer is prevented from
535
-//    draining.
536
-//
537
-//#define ENSURE_SMOOTH_MOVES
538
-#if ENABLED(ENSURE_SMOOTH_MOVES)
539
-  //#define ALWAYS_ALLOW_MENU      // If enabled, the menu will always be responsive.
540
-                                   // WARNING: Menu navigation during short moves may cause stuttering!
541
-  #define LCD_UPDATE_THRESHOLD 135 // (ms) Minimum duration for the current segment to allow an LCD update.
542
-                                   // Default value is good for graphical LCDs (e.g., REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER).
543
-                                   // You may try to lower this value until you printer starts stuttering again as if ENSURE_SMOOTH_MOVES is disabled.
544
-  #define MIN_BLOCK_TIME 6         // (ms) Minimum duration of a single block. You shouldn't need to modify this.
545
-#endif
546
-
547 517
 // @section extruder
548 518
 
549 519
 // extruder advance constant (s2/mm3)

+ 0
- 30
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h 查看文件

@@ -509,36 +509,6 @@
509 509
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
510 510
 #endif
511 511
 
512
-//
513
-// Ensure Smooth Moves
514
-//
515
-// Enable this option to prevent the machine from stuttering when printing multiple short segments.
516
-// This feature uses two strategies to eliminate stuttering:
517
-//
518
-// 1. During short segments a Graphical LCD update may take so much time that the planner buffer gets
519
-//    completely drained. When this happens pauses are introduced between short segments, and print moves
520
-//    will become jerky until a longer segment provides enough time for the buffer to be filled again.
521
-//    This jerkiness negatively affects print quality. The ENSURE_SMOOTH_MOVES option addresses the issue
522
-//    by pausing the LCD until there's enough time to safely update.
523
-//
524
-//    NOTE: This will cause the Info Screen to lag and controller buttons may become unresponsive.
525
-//          Enable ALWAYS_ALLOW_MENU to keep the controller responsive.
526
-//
527
-// 2. No block is allowed to take less time than MIN_BLOCK_TIME. That's the time it takes in the main
528
-//    loop to add a new block to the buffer, check temperatures, etc., including all blocked time due to
529
-//    interrupts (without LCD update). By enforcing a minimum time-per-move, the buffer is prevented from
530
-//    draining.
531
-//
532
-//#define ENSURE_SMOOTH_MOVES
533
-#if ENABLED(ENSURE_SMOOTH_MOVES)
534
-  //#define ALWAYS_ALLOW_MENU      // If enabled, the menu will always be responsive.
535
-                                   // WARNING: Menu navigation during short moves may cause stuttering!
536
-  #define LCD_UPDATE_THRESHOLD 135 // (ms) Minimum duration for the current segment to allow an LCD update.
537
-                                   // Default value is good for graphical LCDs (e.g., REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER).
538
-                                   // You may try to lower this value until you printer starts stuttering again as if ENSURE_SMOOTH_MOVES is disabled.
539
-  #define MIN_BLOCK_TIME 6         // (ms) Minimum duration of a single block. You shouldn't need to modify this.
540
-#endif
541
-
542 512
 // @section extruder
543 513
 
544 514
 // extruder advance constant (s2/mm3)

+ 0
- 30
Marlin/example_configurations/makibox/Configuration_adv.h 查看文件

@@ -507,36 +507,6 @@
507 507
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
508 508
 #endif
509 509
 
510
-//
511
-// Ensure Smooth Moves
512
-//
513
-// Enable this option to prevent the machine from stuttering when printing multiple short segments.
514
-// This feature uses two strategies to eliminate stuttering:
515
-//
516
-// 1. During short segments a Graphical LCD update may take so much time that the planner buffer gets
517
-//    completely drained. When this happens pauses are introduced between short segments, and print moves
518
-//    will become jerky until a longer segment provides enough time for the buffer to be filled again.
519
-//    This jerkiness negatively affects print quality. The ENSURE_SMOOTH_MOVES option addresses the issue
520
-//    by pausing the LCD until there's enough time to safely update.
521
-//
522
-//    NOTE: This will cause the Info Screen to lag and controller buttons may become unresponsive.
523
-//          Enable ALWAYS_ALLOW_MENU to keep the controller responsive.
524
-//
525
-// 2. No block is allowed to take less time than MIN_BLOCK_TIME. That's the time it takes in the main
526
-//    loop to add a new block to the buffer, check temperatures, etc., including all blocked time due to
527
-//    interrupts (without LCD update). By enforcing a minimum time-per-move, the buffer is prevented from
528
-//    draining.
529
-//
530
-//#define ENSURE_SMOOTH_MOVES
531
-#if ENABLED(ENSURE_SMOOTH_MOVES)
532
-  //#define ALWAYS_ALLOW_MENU      // If enabled, the menu will always be responsive.
533
-                                   // WARNING: Menu navigation during short moves may cause stuttering!
534
-  #define LCD_UPDATE_THRESHOLD 135 // (ms) Minimum duration for the current segment to allow an LCD update.
535
-                                   // Default value is good for graphical LCDs (e.g., REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER).
536
-                                   // You may try to lower this value until you printer starts stuttering again as if ENSURE_SMOOTH_MOVES is disabled.
537
-  #define MIN_BLOCK_TIME 6         // (ms) Minimum duration of a single block. You shouldn't need to modify this.
538
-#endif
539
-
540 510
 // @section extruder
541 511
 
542 512
 // extruder advance constant (s2/mm3)

+ 0
- 30
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h 查看文件

@@ -507,36 +507,6 @@
507 507
   #define BABYSTEP_MULTIPLICATOR 1 //faster movements
508 508
 #endif
509 509
 
510
-//
511
-// Ensure Smooth Moves
512
-//
513
-// Enable this option to prevent the machine from stuttering when printing multiple short segments.
514
-// This feature uses two strategies to eliminate stuttering:
515
-//
516
-// 1. During short segments a Graphical LCD update may take so much time that the planner buffer gets
517
-//    completely drained. When this happens pauses are introduced between short segments, and print moves
518
-//    will become jerky until a longer segment provides enough time for the buffer to be filled again.
519
-//    This jerkiness negatively affects print quality. The ENSURE_SMOOTH_MOVES option addresses the issue
520
-//    by pausing the LCD until there's enough time to safely update.
521
-//
522
-//    NOTE: This will cause the Info Screen to lag and controller buttons may become unresponsive.
523
-//          Enable ALWAYS_ALLOW_MENU to keep the controller responsive.
524
-//
525
-// 2. No block is allowed to take less time than MIN_BLOCK_TIME. That's the time it takes in the main
526
-//    loop to add a new block to the buffer, check temperatures, etc., including all blocked time due to
527
-//    interrupts (without LCD update). By enforcing a minimum time-per-move, the buffer is prevented from
528
-//    draining.
529
-//
530
-//#define ENSURE_SMOOTH_MOVES
531
-#if ENABLED(ENSURE_SMOOTH_MOVES)
532
-  //#define ALWAYS_ALLOW_MENU      // If enabled, the menu will always be responsive.
533
-                                   // WARNING: Menu navigation during short moves may cause stuttering!
534
-  #define LCD_UPDATE_THRESHOLD 135 // (ms) Minimum duration for the current segment to allow an LCD update.
535
-                                   // Default value is good for graphical LCDs (e.g., REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER).
536
-                                   // You may try to lower this value until you printer starts stuttering again as if ENSURE_SMOOTH_MOVES is disabled.
537
-  #define MIN_BLOCK_TIME 6         // (ms) Minimum duration of a single block. You shouldn't need to modify this.
538
-#endif
539
-
540 510
 // @section extruder
541 511
 
542 512
 // extruder advance constant (s2/mm3)

+ 5
- 14
Marlin/planner.cpp 查看文件

@@ -145,7 +145,7 @@ float Planner::previous_speed[NUM_AXIS],
145 145
         Planner::position_float[NUM_AXIS] = { 0 };
146 146
 #endif
147 147
 
148
-#if ENABLED(ENSURE_SMOOTH_MOVES)
148
+#if ENABLED(ULTRA_LCD)
149 149
   volatile uint32_t Planner::block_buffer_runtime_us = 0;
150 150
 #endif
151 151
 
@@ -985,30 +985,21 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
985 985
   const uint8_t moves_queued = movesplanned();
986 986
 
987 987
   // Slow down when the buffer starts to empty, rather than wait at the corner for a buffer refill
988
+  unsigned long segment_time = lround(1000000.0 / inverse_mm_s);
988 989
   #if ENABLED(SLOWDOWN)
989 990
     // Segment time im micro seconds
990
-    unsigned long segment_time = lround(1000000.0 / inverse_mm_s);
991 991
     if (moves_queued > 1 && moves_queued < (BLOCK_BUFFER_SIZE) / 2) {
992 992
       if (segment_time < min_segment_time) {
993 993
         // buffer is draining, add extra time.  The amount of time added increases if the buffer is still emptied more.
994 994
         inverse_mm_s = 1000000.0 / (segment_time + lround(2 * (min_segment_time - segment_time) / moves_queued));
995
-        #if defined(XY_FREQUENCY_LIMIT) || ENABLED(ENSURE_SMOOTH_MOVES)
995
+        #if defined(XY_FREQUENCY_LIMIT) || ENABLED(ULTRA_LCD)
996 996
           segment_time = lround(1000000.0 / inverse_mm_s);
997 997
         #endif
998 998
       }
999 999
     }
1000 1000
   #endif
1001
-  
1002
-  #if ENABLED(ENSURE_SMOOTH_MOVES)
1003
-    #if DISABLED(SLOWDOWN)
1004
-      unsigned long segment_time = lround(1000000.0 / inverse_mm_s);
1005
-    #endif
1006
-    if (segment_time < (MIN_BLOCK_TIME) * 1000UL) {
1007
-      // buffer will be draining, set to MIN_BLOCK_TIME.
1008
-      inverse_mm_s = 1000000.0 / (1000.0 * (MIN_BLOCK_TIME));
1009
-      segment_time = (MIN_BLOCK_TIME) * 1000UL;
1010
-    }
1011
-    block->segment_time = segment_time;
1001
+
1002
+  #if ENABLED(ULTRA_LCD)
1012 1003
     CRITICAL_SECTION_START
1013 1004
       block_buffer_runtime_us += segment_time;
1014 1005
     CRITICAL_SECTION_END

+ 11
- 11
Marlin/planner.h 查看文件

@@ -124,9 +124,7 @@ typedef struct {
124 124
     uint32_t valve_pressure, e_to_p_pressure;
125 125
   #endif
126 126
   
127
-  #if ENABLED(ENSURE_SMOOTH_MOVES)
128
-    uint32_t segment_time;
129
-  #endif
127
+  uint32_t segment_time;
130 128
 
131 129
 } block_t;
132 130
 
@@ -214,7 +212,7 @@ class Planner {
214 212
       static float extruder_advance_k;
215 213
     #endif
216 214
 
217
-    #if ENABLED(ENSURE_SMOOTH_MOVES)
215
+    #if ENABLED(ULTRA_LCD)
218 216
       volatile static uint32_t block_buffer_runtime_us; //Theoretical block buffer runtime in µs
219 217
     #endif
220 218
 
@@ -381,33 +379,35 @@ class Planner {
381 379
     static block_t* get_current_block() {
382 380
       if (blocks_queued()) {
383 381
         block_t* block = &block_buffer[block_buffer_tail];
384
-        #if ENABLED(ENSURE_SMOOTH_MOVES)
382
+        #if ENABLED(ULTRA_LCD)
385 383
           block_buffer_runtime_us -= block->segment_time; //We can't be sure how long an active block will take, so don't count it.
386 384
         #endif
387 385
         SBI(block->flag, BLOCK_BIT_BUSY);
388 386
         return block;
389 387
       }
390 388
       else {
391
-        #if ENABLED(ENSURE_SMOOTH_MOVES)
389
+        #if ENABLED(ULTRA_LCD)
392 390
           clear_block_buffer_runtime(); // paranoia. Buffer is empty now - so reset accumulated time to zero.
393 391
         #endif
394 392
         return NULL;
395 393
       }
396 394
     }
397 395
 
398
-    #if ENABLED(ENSURE_SMOOTH_MOVES)
399
-      static bool long_move() {
396
+    #if ENABLED(ULTRA_LCD)
397
+
398
+      static millis_t block_buffer_runtime() {
400 399
         CRITICAL_SECTION_START
401
-          uint32_t bbru = block_buffer_runtime_us;
400
+          millis_t bbru = block_buffer_runtime_us;
402 401
         CRITICAL_SECTION_END
403
-        return !bbru || bbru > (LCD_UPDATE_THRESHOLD) * 1000UL + (MIN_BLOCK_TIME) * 3000UL;
402
+        return bbru;
404 403
       }
405
-      
404
+
406 405
       static void clear_block_buffer_runtime(){
407 406
         CRITICAL_SECTION_START
408 407
           block_buffer_runtime_us = 0;
409 408
         CRITICAL_SECTION_END
410 409
       }
410
+
411 411
     #endif
412 412
 
413 413
     #if ENABLED(AUTOTEMP)

+ 3
- 3
Marlin/stepper.cpp 查看文件

@@ -1098,13 +1098,13 @@ void Stepper::finish_and_disable() {
1098 1098
 
1099 1099
 void Stepper::quick_stop() {
1100 1100
   cleaning_buffer_counter = 5000;
1101
-  #if ENABLED(ENSURE_SMOOTH_MOVES)
1102
-    planner.clear_block_buffer_runtime();
1103
-  #endif
1104 1101
   DISABLE_STEPPER_DRIVER_INTERRUPT();
1105 1102
   while (planner.blocks_queued()) planner.discard_current_block();
1106 1103
   current_block = NULL;
1107 1104
   ENABLE_STEPPER_DRIVER_INTERRUPT();
1105
+  #if ENABLED(ULTRA_LCD)
1106
+    planner.clear_block_buffer_runtime();
1107
+  #endif
1108 1108
 }
1109 1109
 
1110 1110
 void Stepper::endstop_triggered(AxisEnum axis) {

+ 77
- 74
Marlin/ultralcd.cpp 查看文件

@@ -64,6 +64,8 @@ void lcd_status_screen();
64 64
 millis_t next_lcd_update_ms;
65 65
 
66 66
 uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to draw, decrements after every draw. Set to 2 in LCD routines so the LCD gets at least 1 full redraw (first redraw is partial)
67
+millis_t max_display_update_time = 0;
68
+
67 69
 #if ENABLED(DOGLCD)
68 70
   bool drawing_screen = false;
69 71
 #endif
@@ -2893,7 +2895,11 @@ void lcd_update() {
2893 2895
   #endif //SDSUPPORT && SD_DETECT_PIN
2894 2896
 
2895 2897
   millis_t ms = millis();
2896
-  if (ELAPSED(ms, next_lcd_update_ms)) {
2898
+  if (ELAPSED(ms, next_lcd_update_ms)
2899
+    #if ENABLED(DOGLCD)
2900
+      || drawing_screen
2901
+    #endif
2902
+    ) {
2897 2903
 
2898 2904
     next_lcd_update_ms = ms + LCD_UPDATE_INTERVAL;
2899 2905
 
@@ -2954,101 +2960,98 @@ void lcd_update() {
2954 2960
       }
2955 2961
     #endif // ULTIPANEL
2956 2962
 
2957
-    #if ENABLED(ENSURE_SMOOTH_MOVES) && ENABLED(ALWAYS_ALLOW_MENU)
2958
-      #define STATUS_UPDATE_CONDITION planner.long_move()
2959
-    #else
2960
-      #define STATUS_UPDATE_CONDITION true
2961
-    #endif
2962
-    #if ENABLED(ENSURE_SMOOTH_MOVES) && DISABLED(ALWAYS_ALLOW_MENU)
2963
-      #define LCD_HANDLER_CONDITION planner.long_move()
2964
-    #else
2965
-      #define LCD_HANDLER_CONDITION true
2966
-    #endif
2967
-
2968 2963
     // We arrive here every ~100ms when idling often enough.
2969 2964
     // Instead of tracking the changes simply redraw the Info Screen ~1 time a second.
2970 2965
     static int8_t lcd_status_update_delay = 1; // first update one loop delayed
2971
-    if (STATUS_UPDATE_CONDITION &&
2966
+    if (
2972 2967
       #if ENABLED(ULTIPANEL)
2973 2968
         currentScreen == lcd_status_screen &&
2974 2969
       #endif
2975
-        !lcd_status_update_delay--
2970
+      !lcd_status_update_delay--
2976 2971
     ) {
2977
-      lcd_status_update_delay = 9;
2978
-      lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
2979
-    }
2980
-
2981
-    if (LCD_HANDLER_CONDITION) {
2982
-
2972
+      lcd_status_update_delay = 9
2983 2973
       #if ENABLED(DOGLCD)
2984
-        if (lcdDrawUpdate || drawing_screen)
2985
-      #else
2986
-        if (lcdDrawUpdate)
2974
+        + 3
2987 2975
       #endif
2988
-      {
2989
-        #if ENABLED(DOGLCD)
2990
-          if (!drawing_screen)
2991
-        #endif
2992
-          {
2993
-            switch (lcdDrawUpdate) {
2994
-              case LCDVIEW_CALL_NO_REDRAW:
2995
-                lcdDrawUpdate = LCDVIEW_NONE;
2996
-                break;
2997
-              case LCDVIEW_CLEAR_CALL_REDRAW: // set by handlers, then altered after (rarely occurs here)
2998
-              case LCDVIEW_CALL_REDRAW_NEXT:  // set by handlers, then altered after (never occurs here?)
2999
-                lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
3000
-              case LCDVIEW_REDRAW_NOW:        // set above, or by a handler through LCDVIEW_CALL_REDRAW_NEXT
3001
-              case LCDVIEW_NONE:
3002
-                break;
3003
-            } // switch
3004
-          }
3005
-        #if ENABLED(ULTIPANEL)
3006
-          #define CURRENTSCREEN() (*currentScreen)(), lcd_clicked = false
3007
-        #else
3008
-          #define CURRENTSCREEN() lcd_status_screen()
3009
-        #endif
3010
-
3011
-        #if ENABLED(DOGLCD)  // Changes due to different driver architecture of the DOGM display
3012
-          if (!drawing_screen) {
3013
-            u8g.firstPage();
3014
-            drawing_screen = 1;
3015
-          }
3016
-          lcd_setFont(FONT_MENU);
3017
-          CURRENTSCREEN();
3018
-          if (drawing_screen && (drawing_screen = u8g.nextPage())) return;
3019
-        #else
3020
-          CURRENTSCREEN();
3021
-        #endif
3022
-      }
3023
-
3024
-      #if ENABLED(ULTIPANEL)
3025
-
3026
-        // Return to Status Screen after a timeout
3027
-        if (currentScreen == lcd_status_screen || defer_return_to_status)
3028
-          return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS;
3029
-        else if (ELAPSED(ms, return_to_status_ms))
3030
-          lcd_return_to_status();
2976
+      ;
2977
+      max_display_update_time--;
2978
+      lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
2979
+    }
3031 2980
 
3032
-      #endif // ULTIPANEL
2981
+    millis_t bbr = planner.block_buffer_runtime();
3033 2982
 
2983
+    #if ENABLED(DOGLCD)
2984
+      if ((lcdDrawUpdate || drawing_screen) && (!bbr || (bbr > max_display_update_time * 2000)))
2985
+    #else
2986
+      if (lcdDrawUpdate && (!bbr || (bbr > max_display_update_time * 2000)))
2987
+    #endif
2988
+    {
3034 2989
       #if ENABLED(DOGLCD)
3035 2990
         if (!drawing_screen)
3036 2991
       #endif
3037 2992
         {
3038 2993
           switch (lcdDrawUpdate) {
3039
-            case LCDVIEW_CLEAR_CALL_REDRAW:
3040
-              lcd_implementation_clear();
3041
-            case LCDVIEW_CALL_REDRAW_NEXT:
3042
-              lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
3043
-              break;
3044
-            case LCDVIEW_REDRAW_NOW:
2994
+            case LCDVIEW_CALL_NO_REDRAW:
3045 2995
               lcdDrawUpdate = LCDVIEW_NONE;
3046 2996
               break;
2997
+            case LCDVIEW_CLEAR_CALL_REDRAW: // set by handlers, then altered after (rarely occurs here)
2998
+            case LCDVIEW_CALL_REDRAW_NEXT:  // set by handlers, then altered after (never occurs here?)
2999
+              lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
3000
+            case LCDVIEW_REDRAW_NOW:        // set above, or by a handler through LCDVIEW_CALL_REDRAW_NEXT
3047 3001
             case LCDVIEW_NONE:
3048 3002
               break;
3049 3003
           } // switch
3050 3004
         }
3051
-    } // LCD_HANDLER_CONDITION
3005
+      #if ENABLED(ULTIPANEL)
3006
+        #define CURRENTSCREEN() (*currentScreen)(), lcd_clicked = false
3007
+      #else
3008
+        #define CURRENTSCREEN() lcd_status_screen()
3009
+      #endif
3010
+
3011
+      #if ENABLED(DOGLCD)  // Changes due to different driver architecture of the DOGM display
3012
+        if (!drawing_screen) {
3013
+          u8g.firstPage();
3014
+          drawing_screen = 1;
3015
+        }
3016
+        lcd_setFont(FONT_MENU);
3017
+        CURRENTSCREEN();
3018
+        if (drawing_screen && (drawing_screen = u8g.nextPage())) {
3019
+          max_display_update_time = max(max_display_update_time, millis() - ms);
3020
+          return;
3021
+        }
3022
+      #else
3023
+        CURRENTSCREEN();
3024
+      #endif
3025
+      max_display_update_time = max(max_display_update_time, millis() - ms);
3026
+    }
3027
+
3028
+    #if ENABLED(ULTIPANEL)
3029
+
3030
+      // Return to Status Screen after a timeout
3031
+      if (currentScreen == lcd_status_screen || defer_return_to_status)
3032
+        return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS;
3033
+      else if (ELAPSED(ms, return_to_status_ms))
3034
+        lcd_return_to_status();
3035
+
3036
+    #endif // ULTIPANEL
3037
+
3038
+    #if ENABLED(DOGLCD)
3039
+      if (!drawing_screen)
3040
+    #endif
3041
+      {
3042
+        switch (lcdDrawUpdate) {
3043
+          case LCDVIEW_CLEAR_CALL_REDRAW:
3044
+            lcd_implementation_clear();
3045
+          case LCDVIEW_CALL_REDRAW_NEXT:
3046
+            lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
3047
+            break;
3048
+          case LCDVIEW_REDRAW_NOW:
3049
+            lcdDrawUpdate = LCDVIEW_NONE;
3050
+            break;
3051
+          case LCDVIEW_NONE:
3052
+            break;
3053
+        } // switch
3054
+      }
3052 3055
   } // ELAPSED(ms, next_lcd_update_ms)
3053 3056
 }
3054 3057
 

Loading…
取消
儲存