Bladeren bron

Use flag to defer lcd return-to-status

Scott Lahteine 9 jaren geleden
bovenliggende
commit
af89ccf96a
1 gewijzigde bestanden met toevoegingen van 7 en 8 verwijderingen
  1. 7
    8
      Marlin/ultralcd.cpp

+ 7
- 8
Marlin/ultralcd.cpp Bestand weergeven

279
 uint8_t lcd_status_update_delay;
279
 uint8_t lcd_status_update_delay;
280
 bool ignore_click = false;
280
 bool ignore_click = false;
281
 bool wait_for_unclick;
281
 bool wait_for_unclick;
282
+bool defer_return_to_status = false;
282
 uint8_t lcdDrawUpdate = 2;                  /* Set to none-zero when the LCD needs to draw, decreased after every draw. Set to 2 in LCD routines so the LCD gets at least 1 full redraw (first redraw is partial) */
283
 uint8_t lcdDrawUpdate = 2;                  /* Set to none-zero when the LCD needs to draw, decreased after every draw. Set to 2 in LCD routines so the LCD gets at least 1 full redraw (first redraw is partial) */
283
 
284
 
284
 // Variables used when editing values.
285
 // Variables used when editing values.
429
 
430
 
430
 #if ENABLED(ULTIPANEL)
431
 #if ENABLED(ULTIPANEL)
431
 
432
 
432
-static void lcd_return_to_status() { lcd_goto_menu(lcd_status_screen); }
433
+static void lcd_return_to_status() {
434
+  defer_return_to_status = false;
435
+  lcd_goto_menu(lcd_status_screen);
436
+}
433
 
437
 
434
 #if ENABLED(SDSUPPORT)
438
 #if ENABLED(SDSUPPORT)
435
 
439
 
1965
     #if ENABLED(ULTIPANEL)
1969
     #if ENABLED(ULTIPANEL)
1966
 
1970
 
1967
       // Return to Status Screen after a timeout
1971
       // Return to Status Screen after a timeout
1968
-      if (currentMenu != lcd_status_screen &&
1969
-        #if ENABLED(MANUAL_BED_LEVELING)
1970
-          currentMenu != _lcd_level_bed &&
1971
-          currentMenu != _lcd_level_bed_homing &&
1972
-        #endif
1973
-        millis() > return_to_status_ms
1974
-      ) {
1972
+      if (!defer_return_to_status && currentMenu != lcd_status_screen && millis() > return_to_status_ms) {
1975
         lcd_return_to_status();
1973
         lcd_return_to_status();
1976
         lcdDrawUpdate = 2;
1974
         lcdDrawUpdate = 2;
1977
       }
1975
       }
2508
    * MBL entry-point
2506
    * MBL entry-point
2509
    */
2507
    */
2510
   static void lcd_level_bed() {
2508
   static void lcd_level_bed() {
2509
+    defer_return_to_status = true;
2511
     axis_known_position[X_AXIS] = axis_known_position[Y_AXIS] = axis_known_position[Z_AXIS] = false;
2510
     axis_known_position[X_AXIS] = axis_known_position[Y_AXIS] = axis_known_position[Z_AXIS] = false;
2512
     mbl.reset();
2511
     mbl.reset();
2513
     enqueue_and_echo_commands_P(PSTR("G28"));
2512
     enqueue_and_echo_commands_P(PSTR("G28"));

Laden…
Annuleren
Opslaan