Browse Source

More user interaction in MBL

Scott Lahteine 8 years ago
parent
commit
d1c45ff80b
1 changed files with 26 additions and 9 deletions
  1. 26
    9
      Marlin/ultralcd.cpp

+ 26
- 9
Marlin/ultralcd.cpp View File

2540
     }
2540
     }
2541
   }
2541
   }
2542
 
2542
 
2543
-  /**
2544
-   * MBL Move to mesh starting point
2545
-   */
2546
-  static void _lcd_level_bed_homing() {
2547
-    if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_HOMING), NULL);
2548
-    lcdDrawUpdate = 1;
2549
-    if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS]) {
2543
+  static void _lcd_level_bed_homing_done() {
2544
+    if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("Click to Begin"), NULL);
2545
+    lcdDrawUpdate = LCD_DRAW_UPDATE_CALL_NO_REDRAW;
2546
+    if (LCD_CLICKED) {
2550
       current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
2547
       current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
2551
       plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
2548
       plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
2552
       current_position[X_AXIS] = MESH_MIN_X;
2549
       current_position[X_AXIS] = MESH_MIN_X;
2558
   }
2555
   }
2559
 
2556
 
2560
   /**
2557
   /**
2561
-   * MBL entry-point
2558
+   * MBL Move to mesh starting point
2562
    */
2559
    */
2563
-  static void lcd_level_bed() {
2560
+  static void _lcd_level_bed_homing() {
2561
+    if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_HOMING), NULL);
2562
+    lcdDrawUpdate = LCD_DRAW_UPDATE_CALL_NO_REDRAW;
2563
+    if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])
2564
+      lcd_goto_menu(_lcd_level_bed_homing_done);
2565
+  }
2566
+
2567
+  /**
2568
+   * MBL Continue Bed Leveling...
2569
+   */
2570
+  static void lcd_level_bed_continue() {
2564
     defer_return_to_status = true;
2571
     defer_return_to_status = true;
2565
     axis_known_position[X_AXIS] = axis_known_position[Y_AXIS] = axis_known_position[Z_AXIS] = false;
2572
     axis_known_position[X_AXIS] = axis_known_position[Y_AXIS] = axis_known_position[Z_AXIS] = false;
2566
     mbl.reset();
2573
     mbl.reset();
2568
     lcd_goto_menu(_lcd_level_bed_homing, true);
2575
     lcd_goto_menu(_lcd_level_bed_homing, true);
2569
   }
2576
   }
2570
 
2577
 
2578
+  /**
2579
+   * MBL entry-point
2580
+   */
2581
+  static void lcd_level_bed() {
2582
+    START_MENU();
2583
+    MENU_ITEM(back, "Cancel", lcd_prepare_menu);
2584
+    MENU_ITEM(submenu, MSG_LEVEL_BED, lcd_level_bed_continue);
2585
+    END_MENU();
2586
+  }
2587
+
2571
 #endif  // MANUAL_BED_LEVELING
2588
 #endif  // MANUAL_BED_LEVELING
2572
 
2589
 
2573
 #endif // ULTRA_LCD
2590
 #endif // ULTRA_LCD

Loading…
Cancel
Save