Browse Source

Merge pull request #1984 from thinkyhead/leveling_menu_items

Level Bed in Prepare submenu
Scott Lahteine 9 years ago
parent
commit
ed988e39a8

+ 0
- 1
Marlin/Configuration_adv.h View File

258
 #define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
258
 #define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
259
 #define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
259
 #define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
260
 #define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
260
 #define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
261
-//#define ENCODER_RATE_MULTIPLIER_DEBUG  // If defined, output the encoder steps per second value
262
 
261
 
263
 //#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
262
 //#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
264
 #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
263
 #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again

+ 0
- 1
Marlin/configurator/config/Configuration_adv.h View File

258
 #define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
258
 #define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
259
 #define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
259
 #define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
260
 #define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
260
 #define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
261
-//#define ENCODER_RATE_MULTIPLIER_DEBUG  // If defined, output the encoder steps per second value
262
 
261
 
263
 //#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
262
 //#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
264
 #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
263
 #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again

+ 1
- 0
Marlin/dogm_lcd_implementation.h View File

172
 
172
 
173
 static bool show_splashscreen = true;
173
 static bool show_splashscreen = true;
174
 
174
 
175
+/* Warning: This function is called from interrupt context */
175
 static void lcd_implementation_init() {
176
 static void lcd_implementation_init() {
176
 
177
 
177
   #ifdef LCD_PIN_BL // Enable LCD backlight
178
   #ifdef LCD_PIN_BL // Enable LCD backlight

+ 0
- 1
Marlin/example_configurations/Felix/Configuration_adv.h View File

258
 #define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
258
 #define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
259
 #define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
259
 #define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
260
 #define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
260
 #define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
261
-//#define ENCODER_RATE_MULTIPLIER_DEBUG  // If defined, output the encoder steps per second value
262
 
261
 
263
 //#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
262
 //#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
264
 #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
263
 #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again

+ 0
- 1
Marlin/example_configurations/Hephestos/Configuration_adv.h View File

258
 #define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
258
 #define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
259
 #define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
259
 #define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
260
 #define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
260
 #define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
261
-//#define ENCODER_RATE_MULTIPLIER_DEBUG  // If defined, output the encoder steps per second value
262
 
261
 
263
 //#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
262
 //#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
264
 #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
263
 #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again

+ 0
- 1
Marlin/example_configurations/K8200/Configuration_adv.h View File

258
 #define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
258
 #define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
259
 #define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
259
 #define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
260
 #define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
260
 #define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
261
-//#define ENCODER_RATE_MULTIPLIER_DEBUG  // If defined, output the encoder steps per second value
262
 
261
 
263
 //#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
262
 //#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
264
 #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
263
 #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again

+ 0
- 1
Marlin/example_configurations/SCARA/Configuration_adv.h View File

258
 #define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
258
 #define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
259
 #define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
259
 #define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
260
 #define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
260
 #define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
261
-//#define ENCODER_RATE_MULTIPLIER_DEBUG  // If defined, output the encoder steps per second value
262
 
261
 
263
 //#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
262
 //#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
264
 #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
263
 #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again

+ 0
- 1
Marlin/example_configurations/WITBOX/Configuration_adv.h View File

258
 #define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
258
 #define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
259
 #define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
259
 #define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
260
 #define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
260
 #define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
261
-//#define ENCODER_RATE_MULTIPLIER_DEBUG  // If defined, output the encoder steps per second value
262
 
261
 
263
 //#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
262
 //#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
264
 #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
263
 #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again

+ 0
- 1
Marlin/example_configurations/delta/generic/Configuration_adv.h View File

259
 #define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
259
 #define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
260
 #define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
260
 #define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
261
 #define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
261
 #define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
262
-//#define ENCODER_RATE_MULTIPLIER_DEBUG  // If defined, output the encoder steps per second value
263
 
262
 
264
 //#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
263
 //#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
265
 #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
264
 #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again

+ 0
- 1
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h View File

258
 #define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
258
 #define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
259
 #define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
259
 #define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
260
 #define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
260
 #define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
261
-//#define ENCODER_RATE_MULTIPLIER_DEBUG  // If defined, output the encoder steps per second value
262
 
261
 
263
 //#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
262
 //#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
264
 #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
263
 #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again

+ 0
- 1
Marlin/example_configurations/makibox/Configuration_adv.h View File

258
 #define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
258
 #define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
259
 #define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
259
 #define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
260
 #define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
260
 #define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
261
-//#define ENCODER_RATE_MULTIPLIER_DEBUG  // If defined, output the encoder steps per second value
262
 
261
 
263
 //#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
262
 //#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
264
 #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
263
 #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again

+ 0
- 1
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h View File

258
 #define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
258
 #define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
259
 #define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
259
 #define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
260
 #define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
260
 #define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
261
-//#define ENCODER_RATE_MULTIPLIER_DEBUG  // If defined, output the encoder steps per second value
262
 
261
 
263
 //#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
262
 //#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
264
 #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
263
 #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again

+ 305
- 114
Marlin/ultralcd.cpp View File

173
   } while(0)
173
   } while(0)
174
 
174
 
175
   #ifdef ENCODER_RATE_MULTIPLIER
175
   #ifdef ENCODER_RATE_MULTIPLIER
176
+
177
+    //#define ENCODER_RATE_MULTIPLIER_DEBUG  // If defined, output the encoder steps per second value
178
+
176
     /**
179
     /**
177
      * MENU_MULTIPLIER_ITEM generates drawing and handling code for a multiplier menu item
180
      * MENU_MULTIPLIER_ITEM generates drawing and handling code for a multiplier menu item
178
      */
181
      */
246
 // place-holders for Ki and Kd edits
249
 // place-holders for Ki and Kd edits
247
 float raw_Ki, raw_Kd;
250
 float raw_Ki, raw_Kd;
248
 
251
 
252
+/**
253
+ * General function to go directly to a menu
254
+ */
249
 static void lcd_goto_menu(menuFunc_t menu, const bool feedback=false, const uint32_t encoder=0) {
255
 static void lcd_goto_menu(menuFunc_t menu, const bool feedback=false, const uint32_t encoder=0) {
250
   if (currentMenu != menu) {
256
   if (currentMenu != menu) {
251
     currentMenu = menu;
257
     currentMenu = menu;
260
   }
266
   }
261
 }
267
 }
262
 
268
 
263
-/* Main status screen. It's up to the implementation specific part to show what is needed. As this is very display dependent */
269
+/**
270
+ *
271
+ * "Info Screen"
272
+ *
273
+ * This is very display-dependent, so the lcd implementation draws this.
274
+ */
275
+
264
 static void lcd_status_screen() {
276
 static void lcd_status_screen() {
265
 	encoderRateMultiplierEnabled = false;
277
 	encoderRateMultiplierEnabled = false;
266
 
278
 
371
   lcd_setstatus(MSG_PRINT_ABORTED, true);
383
   lcd_setstatus(MSG_PRINT_ABORTED, true);
372
 }
384
 }
373
 
385
 
374
-/* Menu implementation */
386
+/**
387
+ *
388
+ * "Main" menu
389
+ *
390
+ */
391
+
375
 static void lcd_main_menu() {
392
 static void lcd_main_menu() {
376
   START_MENU();
393
   START_MENU();
377
   MENU_ITEM(back, MSG_WATCH, lcd_status_screen);
394
   MENU_ITEM(back, MSG_WATCH, lcd_status_screen);
453
 
470
 
454
 #endif //BABYSTEPPING
471
 #endif //BABYSTEPPING
455
 
472
 
473
+/**
474
+ *
475
+ * "Tune" submenu
476
+ *
477
+ */
478
+
456
 static void lcd_tune_menu() {
479
 static void lcd_tune_menu() {
457
   START_MENU();
480
   START_MENU();
458
   MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
481
   MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
594
   lcd_return_to_status();
617
   lcd_return_to_status();
595
 }
618
 }
596
 
619
 
620
+/**
621
+ *
622
+ * "Prepare" submenu
623
+ *
624
+ */
625
+
597
 static void lcd_prepare_menu() {
626
 static void lcd_prepare_menu() {
598
   START_MENU();
627
   START_MENU();
628
+
629
+  //
630
+  // ^ Main
631
+  //
599
   MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
632
   MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
600
-  #if defined( SDSUPPORT ) && defined( MENU_ADDAUTOSTART )
601
-    MENU_ITEM(function, MSG_AUTOSTART, lcd_autostart_sd);
602
-  #endif
603
-  MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84"));
633
+
634
+  //
635
+  // Auto Home
636
+  //
604
   MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
637
   MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
638
+
639
+  //
640
+  // Set Home Offsets
641
+  //
605
   MENU_ITEM(function, MSG_SET_HOME_OFFSETS, lcd_set_home_offsets);
642
   MENU_ITEM(function, MSG_SET_HOME_OFFSETS, lcd_set_home_offsets);
606
   //MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0"));
643
   //MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0"));
607
 
644
 
645
+  //
646
+  // Level Bed
647
+  //
648
+  #ifdef ENABLE_AUTO_BED_LEVELING
649
+    if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS])
650
+      MENU_ITEM(gcode, MSG_LEVEL_BED, PSTR("G29"));
651
+  #elif defined(MANUAL_BED_LEVELING)
652
+    MENU_ITEM(submenu, MSG_LEVEL_BED, lcd_level_bed);
653
+  #endif
654
+
655
+  //
656
+  // Move Axis
657
+  //
658
+  MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu);
659
+
660
+  //
661
+  // Disable Steppers
662
+  //
663
+  MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84"));
664
+
665
+  //
666
+  // Preheat PLA
667
+  // Preheat ABS
668
+  //
608
   #if TEMP_SENSOR_0 != 0
669
   #if TEMP_SENSOR_0 != 0
609
     #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_BED != 0
670
     #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_BED != 0
610
       MENU_ITEM(submenu, MSG_PREHEAT_PLA, lcd_preheat_pla_menu);
671
       MENU_ITEM(submenu, MSG_PREHEAT_PLA, lcd_preheat_pla_menu);
615
     #endif
676
     #endif
616
   #endif
677
   #endif
617
 
678
 
679
+  //
680
+  // Cooldown
681
+  //
618
   MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown);
682
   MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown);
619
 
683
 
684
+  //
685
+  // Switch power on/off
686
+  //
620
   #if HAS_POWER_SWITCH
687
   #if HAS_POWER_SWITCH
621
     if (powersupply)
688
     if (powersupply)
622
       MENU_ITEM(gcode, MSG_SWITCH_PS_OFF, PSTR("M81"));
689
       MENU_ITEM(gcode, MSG_SWITCH_PS_OFF, PSTR("M81"));
624
       MENU_ITEM(gcode, MSG_SWITCH_PS_ON, PSTR("M80"));
691
       MENU_ITEM(gcode, MSG_SWITCH_PS_ON, PSTR("M80"));
625
   #endif
692
   #endif
626
 
693
 
627
-  MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu);
628
-
629
-  #if defined(MANUAL_BED_LEVELING)
630
-    MENU_ITEM(submenu, MSG_LEVEL_BED, lcd_level_bed);
694
+  //
695
+  // Autostart
696
+  //
697
+  #if defined(SDSUPPORT) && defined(MENU_ADDAUTOSTART)
698
+    MENU_ITEM(function, MSG_AUTOSTART, lcd_autostart_sd);
631
   #endif
699
   #endif
632
-	
700
+
633
   END_MENU();
701
   END_MENU();
634
 }
702
 }
635
 
703
 
657
   #endif
725
   #endif
658
 }
726
 }
659
 
727
 
728
+/**
729
+ *
730
+ * "Prepare" > "Move Axis" submenu
731
+ *
732
+ */
733
+
660
 float move_menu_scale;
734
 float move_menu_scale;
661
 static void lcd_move_menu_axis();
735
 static void lcd_move_menu_axis();
662
 
736
 
687
   if (LCD_CLICKED) lcd_goto_menu(lcd_move_menu_axis);
761
   if (LCD_CLICKED) lcd_goto_menu(lcd_move_menu_axis);
688
 }
762
 }
689
 
763
 
764
+/**
765
+ *
766
+ * "Prepare" > "Move Xmm" > "Move XYZ" submenu
767
+ *
768
+ */
769
+
690
 static void lcd_move_menu_axis() {
770
 static void lcd_move_menu_axis() {
691
   START_MENU();
771
   START_MENU();
692
   MENU_ITEM(back, MSG_MOVE_AXIS, lcd_move_menu);
772
   MENU_ITEM(back, MSG_MOVE_AXIS, lcd_move_menu);
712
   lcd_move_menu_axis();
792
   lcd_move_menu_axis();
713
 }
793
 }
714
 
794
 
795
+/**
796
+ *
797
+ * "Prepare" > "Move Axis" submenu
798
+ *
799
+ */
800
+
715
 static void lcd_move_menu() {
801
 static void lcd_move_menu() {
716
   START_MENU();
802
   START_MENU();
717
   MENU_ITEM(back, MSG_PREPARE, lcd_prepare_menu);
803
   MENU_ITEM(back, MSG_PREPARE, lcd_prepare_menu);
722
   END_MENU();
808
   END_MENU();
723
 }
809
 }
724
 
810
 
811
+/**
812
+ *
813
+ * "Control" submenu
814
+ *
815
+ */
816
+
725
 static void lcd_control_menu() {
817
 static void lcd_control_menu() {
726
   START_MENU();
818
   START_MENU();
727
   MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
819
   MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
744
   END_MENU();
836
   END_MENU();
745
 }
837
 }
746
 
838
 
839
+/**
840
+ *
841
+ * "Temperature" submenu
842
+ *
843
+ */
844
+
747
 #ifdef PIDTEMP
845
 #ifdef PIDTEMP
748
 
846
 
749
   // Helpers for editing PID Ki & Kd values
847
   // Helpers for editing PID Ki & Kd values
775
 
873
 
776
 #endif //PIDTEMP
874
 #endif //PIDTEMP
777
 
875
 
876
+/**
877
+ *
878
+ * "Control" > "Temperature" submenu
879
+ *
880
+ */
881
+
778
 static void lcd_control_temperature_menu() {
882
 static void lcd_control_temperature_menu() {
779
   START_MENU();
883
   START_MENU();
780
   MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
884
   MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
863
   END_MENU();
967
   END_MENU();
864
 }
968
 }
865
 
969
 
970
+/**
971
+ *
972
+ * "Temperature" > "Preheat PLA conf" submenu
973
+ *
974
+ */
975
+
866
 static void lcd_control_temperature_preheat_pla_settings_menu() {
976
 static void lcd_control_temperature_preheat_pla_settings_menu() {
867
   START_MENU();
977
   START_MENU();
868
   MENU_ITEM(back, MSG_TEMPERATURE, lcd_control_temperature_menu);
978
   MENU_ITEM(back, MSG_TEMPERATURE, lcd_control_temperature_menu);
879
   END_MENU();
989
   END_MENU();
880
 }
990
 }
881
 
991
 
992
+/**
993
+ *
994
+ * "Temperature" > "Preheat ABS conf" submenu
995
+ *
996
+ */
997
+
882
 static void lcd_control_temperature_preheat_abs_settings_menu() {
998
 static void lcd_control_temperature_preheat_abs_settings_menu() {
883
   START_MENU();
999
   START_MENU();
884
   MENU_ITEM(back, MSG_TEMPERATURE, lcd_control_temperature_menu);
1000
   MENU_ITEM(back, MSG_TEMPERATURE, lcd_control_temperature_menu);
895
   END_MENU();
1011
   END_MENU();
896
 }
1012
 }
897
 
1013
 
1014
+/**
1015
+ *
1016
+ * "Control" > "Motion" submenu
1017
+ *
1018
+ */
1019
+
898
 static void lcd_control_motion_menu() {
1020
 static void lcd_control_motion_menu() {
899
   START_MENU();
1021
   START_MENU();
900
   MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
1022
   MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
931
   END_MENU();
1053
   END_MENU();
932
 }
1054
 }
933
 
1055
 
1056
+/**
1057
+ *
1058
+ * "Control" > "Filament" submenu
1059
+ *
1060
+ */
1061
+
934
 static void lcd_control_volumetric_menu() {
1062
 static void lcd_control_volumetric_menu() {
935
   START_MENU();
1063
   START_MENU();
936
   MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
1064
   MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
953
   END_MENU();
1081
   END_MENU();
954
 }
1082
 }
955
 
1083
 
1084
+/**
1085
+ *
1086
+ * "Control" > "Contrast" submenu
1087
+ *
1088
+ */
1089
+
956
 #ifdef HAS_LCD_CONTRAST
1090
 #ifdef HAS_LCD_CONTRAST
957
   static void lcd_set_contrast() {
1091
   static void lcd_set_contrast() {
958
     if (encoderPosition != 0) {
1092
     if (encoderPosition != 0) {
967
   }
1101
   }
968
 #endif // HAS_LCD_CONTRAST
1102
 #endif // HAS_LCD_CONTRAST
969
 
1103
 
1104
+/**
1105
+ *
1106
+ * "Control" > "Retract" submenu
1107
+ *
1108
+ */
1109
+
970
 #ifdef FWRETRACT
1110
 #ifdef FWRETRACT
971
   static void lcd_control_retract_menu() {
1111
   static void lcd_control_retract_menu() {
972
     START_MENU();
1112
     START_MENU();
999
   currentMenuViewOffset = 0;
1139
   currentMenuViewOffset = 0;
1000
 }
1140
 }
1001
 
1141
 
1142
+/**
1143
+ *
1144
+ * "Print from SD" submenu
1145
+ *
1146
+ */
1147
+
1002
 void lcd_sdcard_menu() {
1148
 void lcd_sdcard_menu() {
1003
   if (lcdDrawUpdate == 0 && LCD_CLICKED == 0) return;	// nothing to do (so don't thrash the SD card)
1149
   if (lcdDrawUpdate == 0 && LCD_CLICKED == 0) return;	// nothing to do (so don't thrash the SD card)
1004
   uint16_t fileCnt = card.getnrfilenames();
1150
   uint16_t fileCnt = card.getnrfilenames();
1034
   END_MENU();
1180
   END_MENU();
1035
 }
1181
 }
1036
 
1182
 
1183
+/**
1184
+ *
1185
+ * Functions for editing single values
1186
+ *
1187
+ */
1037
 #define menu_edit_type(_type, _name, _strFunc, scale) \
1188
 #define menu_edit_type(_type, _name, _strFunc, scale) \
1038
   bool _menu_edit_ ## _name () { \
1189
   bool _menu_edit_ ## _name () { \
1039
     bool isClicked = LCD_CLICKED; \
1190
     bool isClicked = LCD_CLICKED; \
1080
 menu_edit_type(float, float52, ftostr52, 100)
1231
 menu_edit_type(float, float52, ftostr52, 100)
1081
 menu_edit_type(unsigned long, long5, ftostr5, 0.01)
1232
 menu_edit_type(unsigned long, long5, ftostr5, 0.01)
1082
 
1233
 
1234
+/**
1235
+ *
1236
+ * Handlers for RepRap World Keypad input
1237
+ *
1238
+ */
1083
 #ifdef REPRAPWORLD_KEYPAD
1239
 #ifdef REPRAPWORLD_KEYPAD
1084
   static void reprapworld_keypad_move_z_up() {
1240
   static void reprapworld_keypad_move_z_up() {
1085
     encoderPosition = 1;
1241
     encoderPosition = 1;
1114
   static void reprapworld_keypad_move_home() {
1270
   static void reprapworld_keypad_move_home() {
1115
     enqueuecommands_P((PSTR("G28"))); // move all axis home
1271
     enqueuecommands_P((PSTR("G28"))); // move all axis home
1116
   }
1272
   }
1117
-#endif //REPRAPWORLD_KEYPAD
1273
+#endif // REPRAPWORLD_KEYPAD
1118
 
1274
 
1119
-/** End of menus **/
1120
 
1275
 
1276
+/**
1277
+ *
1278
+ * Audio feedback for controller clicks
1279
+ *
1280
+ */
1121
 void lcd_quick_feedback() {
1281
 void lcd_quick_feedback() {
1122
   lcdDrawUpdate = 2;
1282
   lcdDrawUpdate = 2;
1123
   next_button_update_ms = millis() + 500;
1283
   next_button_update_ms = millis() + 500;
1146
   #endif
1306
   #endif
1147
 }
1307
 }
1148
 
1308
 
1149
-/** Menu action functions **/
1150
-static void menu_action_back(menuFunc_t data) { lcd_goto_menu(data); }
1151
-static void menu_action_submenu(menuFunc_t data) { lcd_goto_menu(data); }
1309
+/**
1310
+ *
1311
+ * Menu actions
1312
+ *
1313
+ */
1314
+static void menu_action_back(menuFunc_t func) { lcd_goto_menu(func); }
1315
+static void menu_action_submenu(menuFunc_t func) { lcd_goto_menu(func); }
1152
 static void menu_action_gcode(const char* pgcode) { enqueuecommands_P(pgcode); }
1316
 static void menu_action_gcode(const char* pgcode) { enqueuecommands_P(pgcode); }
1153
-static void menu_action_function(menuFunc_t data) { (*data)(); }
1317
+static void menu_action_function(menuFunc_t func) { (*func)(); }
1154
 static void menu_action_sdfile(const char* filename, char* longFilename) {
1318
 static void menu_action_sdfile(const char* filename, char* longFilename) {
1155
   char cmd[30];
1319
   char cmd[30];
1156
   char* c;
1320
   char* c;
1243
   return j;
1407
   return j;
1244
 }
1408
 }
1245
 
1409
 
1410
+/**
1411
+ * Update the LCD, read encoder buttons, etc.
1412
+ *   - Read button states
1413
+ *   - Check the SD Card slot state
1414
+ *   - Act on RepRap World keypad input
1415
+ *   - Update the encoder position
1416
+ *   - Apply acceleration to the encoder position
1417
+ *   - Reset the Info Screen timeout if there's any input
1418
+ *   - Update status indicators, if any
1419
+ *   - Clear the LCD if lcdDrawUpdate == 2
1420
+ *
1421
+ * Warning: This function is called from interrupt context!
1422
+ */
1246
 void lcd_update() {
1423
 void lcd_update() {
1247
   #ifdef ULTIPANEL
1424
   #ifdef ULTIPANEL
1248
     static millis_t return_to_status_ms = 0;
1425
     static millis_t return_to_status_ms = 0;
1381
 
1558
 
1382
     if (lcdDrawUpdate == 2) lcd_implementation_clear();
1559
     if (lcdDrawUpdate == 2) lcd_implementation_clear();
1383
     if (lcdDrawUpdate) lcdDrawUpdate--;
1560
     if (lcdDrawUpdate) lcdDrawUpdate--;
1384
-    next_lcd_update_ms = millis() + LCD_UPDATE_INTERVAL;
1561
+    next_lcd_update_ms = ms + LCD_UPDATE_INTERVAL;
1385
   }
1562
   }
1386
 }
1563
 }
1387
 
1564
 
1454
 
1631
 
1455
 #ifdef ULTIPANEL
1632
 #ifdef ULTIPANEL
1456
 
1633
 
1457
-////////////////////////
1458
-// Setup Rotary Encoder Bit Values (for two pin encoders to indicate movement)
1459
-// These values are independent of which pins are used for EN_A and EN_B indications
1460
-// The rotary encoder part is also independent to the chipset used for the LCD
1461
-#if defined(EN_A) && defined(EN_B)
1462
-  #define encrot0 0
1463
-  #define encrot1 2
1464
-  #define encrot2 3
1465
-  #define encrot3 1
1466
-#endif 
1467
-
1468
-/* Warning: This function is called from interrupt context */
1469
-void lcd_buttons_update() {
1470
-  #ifdef NEWPANEL
1471
-    uint8_t newbutton = 0;
1472
-    if (READ(BTN_EN1) == 0) newbutton |= EN_A;
1473
-    if (READ(BTN_EN2) == 0) newbutton |= EN_B;
1474
-    #if BTN_ENC > 0
1475
-      if (millis() > next_button_update_ms && READ(BTN_ENC) == 0) newbutton |= EN_C;
1476
-    #endif
1477
-    buttons = newbutton;
1478
-    #ifdef LCD_HAS_SLOW_BUTTONS
1479
-      buttons |= slow_buttons;
1480
-    #endif
1481
-    #ifdef REPRAPWORLD_KEYPAD
1482
-      // for the reprapworld_keypad
1483
-      uint8_t newbutton_reprapworld_keypad=0;
1634
+  /**
1635
+   * Setup Rotary Encoder Bit Values (for two pin encoders to indicate movement)
1636
+   * These values are independent of which pins are used for EN_A and EN_B indications
1637
+   * The rotary encoder part is also independent to the chipset used for the LCD
1638
+   */
1639
+  #if defined(EN_A) && defined(EN_B)
1640
+    #define encrot0 0
1641
+    #define encrot1 2
1642
+    #define encrot2 3
1643
+    #define encrot3 1
1644
+  #endif 
1645
+
1646
+  /**
1647
+   * Read encoder buttons from the hardware registers
1648
+   * Warning: This function is called from interrupt context!
1649
+   */
1650
+  void lcd_buttons_update() {
1651
+    #ifdef NEWPANEL
1652
+      uint8_t newbutton = 0;
1653
+      if (READ(BTN_EN1) == 0) newbutton |= EN_A;
1654
+      if (READ(BTN_EN2) == 0) newbutton |= EN_B;
1655
+      #if BTN_ENC > 0
1656
+        if (millis() > next_button_update_ms && READ(BTN_ENC) == 0) newbutton |= EN_C;
1657
+      #endif
1658
+      buttons = newbutton;
1659
+      #ifdef LCD_HAS_SLOW_BUTTONS
1660
+        buttons |= slow_buttons;
1661
+      #endif
1662
+      #ifdef REPRAPWORLD_KEYPAD
1663
+        // for the reprapworld_keypad
1664
+        uint8_t newbutton_reprapworld_keypad=0;
1665
+        WRITE(SHIFT_LD, LOW);
1666
+        WRITE(SHIFT_LD, HIGH);
1667
+        for(int8_t i = 0; i < 8; i++) {
1668
+          newbutton_reprapworld_keypad >>= 1;
1669
+          if (READ(SHIFT_OUT)) newbutton_reprapworld_keypad |= BIT(7);
1670
+          WRITE(SHIFT_CLK, HIGH);
1671
+          WRITE(SHIFT_CLK, LOW);
1672
+        }
1673
+        buttons_reprapworld_keypad=~newbutton_reprapworld_keypad; //invert it, because a pressed switch produces a logical 0
1674
+      #endif
1675
+    #else   //read it from the shift register
1676
+      uint8_t newbutton = 0;
1484
       WRITE(SHIFT_LD, LOW);
1677
       WRITE(SHIFT_LD, LOW);
1485
       WRITE(SHIFT_LD, HIGH);
1678
       WRITE(SHIFT_LD, HIGH);
1486
-      for(int8_t i = 0; i < 8; i++) {
1487
-        newbutton_reprapworld_keypad >>= 1;
1488
-        if (READ(SHIFT_OUT)) newbutton_reprapworld_keypad |= BIT(7);
1679
+      unsigned char tmp_buttons = 0;
1680
+      for(int8_t i=0; i<8; i++) {
1681
+        newbutton >>= 1;
1682
+        if (READ(SHIFT_OUT)) newbutton |= BIT(7);
1489
         WRITE(SHIFT_CLK, HIGH);
1683
         WRITE(SHIFT_CLK, HIGH);
1490
         WRITE(SHIFT_CLK, LOW);
1684
         WRITE(SHIFT_CLK, LOW);
1491
       }
1685
       }
1492
-      buttons_reprapworld_keypad=~newbutton_reprapworld_keypad; //invert it, because a pressed switch produces a logical 0
1493
-    #endif
1494
-  #else   //read it from the shift register
1495
-    uint8_t newbutton = 0;
1496
-    WRITE(SHIFT_LD, LOW);
1497
-    WRITE(SHIFT_LD, HIGH);
1498
-    unsigned char tmp_buttons = 0;
1499
-    for(int8_t i=0; i<8; i++) {
1500
-      newbutton >>= 1;
1501
-      if (READ(SHIFT_OUT)) newbutton |= BIT(7);
1502
-      WRITE(SHIFT_CLK, HIGH);
1503
-      WRITE(SHIFT_CLK, LOW);
1504
-    }
1505
-    buttons = ~newbutton; //invert it, because a pressed switch produces a logical 0
1506
-  #endif //!NEWPANEL
1507
-
1508
-  //manage encoder rotation
1509
-  uint8_t enc=0;
1510
-  if (buttons & EN_A) enc |= B01;
1511
-  if (buttons & EN_B) enc |= B10;
1512
-  if (enc != lastEncoderBits) {
1513
-    switch(enc) {
1514
-      case encrot0:
1515
-        if (lastEncoderBits==encrot3) encoderDiff++;
1516
-        else if (lastEncoderBits==encrot1) encoderDiff--;
1517
-        break;
1518
-      case encrot1:
1519
-        if (lastEncoderBits==encrot0) encoderDiff++;
1520
-        else if (lastEncoderBits==encrot2) encoderDiff--;
1521
-        break;
1522
-      case encrot2:
1523
-        if (lastEncoderBits==encrot1) encoderDiff++;
1524
-        else if (lastEncoderBits==encrot3) encoderDiff--;
1525
-        break;
1526
-      case encrot3:
1527
-        if (lastEncoderBits==encrot2) encoderDiff++;
1528
-        else if (lastEncoderBits==encrot0) encoderDiff--;
1529
-        break;
1686
+      buttons = ~newbutton; //invert it, because a pressed switch produces a logical 0
1687
+    #endif //!NEWPANEL
1688
+
1689
+    //manage encoder rotation
1690
+    uint8_t enc=0;
1691
+    if (buttons & EN_A) enc |= B01;
1692
+    if (buttons & EN_B) enc |= B10;
1693
+    if (enc != lastEncoderBits) {
1694
+      switch(enc) {
1695
+        case encrot0:
1696
+          if (lastEncoderBits==encrot3) encoderDiff++;
1697
+          else if (lastEncoderBits==encrot1) encoderDiff--;
1698
+          break;
1699
+        case encrot1:
1700
+          if (lastEncoderBits==encrot0) encoderDiff++;
1701
+          else if (lastEncoderBits==encrot2) encoderDiff--;
1702
+          break;
1703
+        case encrot2:
1704
+          if (lastEncoderBits==encrot1) encoderDiff++;
1705
+          else if (lastEncoderBits==encrot3) encoderDiff--;
1706
+          break;
1707
+        case encrot3:
1708
+          if (lastEncoderBits==encrot2) encoderDiff++;
1709
+          else if (lastEncoderBits==encrot0) encoderDiff--;
1710
+          break;
1711
+      }
1530
     }
1712
     }
1713
+    lastEncoderBits = enc;
1531
   }
1714
   }
1532
-  lastEncoderBits = enc;
1533
-}
1534
-
1535
-bool lcd_detected(void) {
1536
-  #if (defined(LCD_I2C_TYPE_MCP23017) || defined(LCD_I2C_TYPE_MCP23008)) && defined(DETECT_DEVICE)
1537
-    return lcd.LcdDetected() == 1;
1538
-  #else
1539
-    return true;
1540
-  #endif
1541
-}
1542
 
1715
 
1543
-void lcd_buzz(long duration, uint16_t freq) {
1544
-  if (freq > 0) {
1545
-    #if BEEPER > 0
1546
-      SET_OUTPUT(BEEPER);
1547
-      tone(BEEPER, freq, duration);
1548
-      delay(duration);
1549
-    #elif defined(LCD_USE_I2C_BUZZER)
1550
-      lcd.buzz(duration, freq);
1716
+  bool lcd_detected(void) {
1717
+    #if (defined(LCD_I2C_TYPE_MCP23017) || defined(LCD_I2C_TYPE_MCP23008)) && defined(DETECT_DEVICE)
1718
+      return lcd.LcdDetected() == 1;
1551
     #else
1719
     #else
1552
-      delay(duration);
1720
+      return true;
1553
     #endif
1721
     #endif
1554
   }
1722
   }
1555
-  else {
1556
-    delay(duration);
1723
+
1724
+  void lcd_buzz(long duration, uint16_t freq) {
1725
+    if (freq > 0) {
1726
+      #if BEEPER > 0
1727
+        SET_OUTPUT(BEEPER);
1728
+        tone(BEEPER, freq, duration);
1729
+        delay(duration);
1730
+      #elif defined(LCD_USE_I2C_BUZZER)
1731
+        lcd.buzz(duration, freq);
1732
+      #else
1733
+        delay(duration);
1734
+      #endif
1735
+    }
1736
+    else {
1737
+      delay(duration);
1738
+    }
1557
   }
1739
   }
1558
-}
1559
 
1740
 
1560
-bool lcd_clicked() { return LCD_CLICKED; }
1741
+  bool lcd_clicked() { return LCD_CLICKED; }
1561
 
1742
 
1562
-#endif //ULTIPANEL
1743
+#endif // ULTIPANEL
1563
 
1744
 
1564
 /*********************************/
1745
 /*********************************/
1565
 /** Number to string conversion **/
1746
 /** Number to string conversion **/
1621
 }
1802
 }
1622
 
1803
 
1623
 // Convert float to string with 1.234 format
1804
 // Convert float to string with 1.234 format
1624
-char *ftostr43(const float &x)
1625
-{
1805
+char *ftostr43(const float &x) {
1626
 	long xx = x * 1000;
1806
 	long xx = x * 1000;
1627
     if (xx >= 0)
1807
     if (xx >= 0)
1628
 		conv[0] = (xx / 1000) % 10 + '0';
1808
 		conv[0] = (xx / 1000) % 10 + '0';
1638
 }
1818
 }
1639
 
1819
 
1640
 // Convert float to string with 1.23 format
1820
 // Convert float to string with 1.23 format
1641
-char *ftostr12ns(const float &x)
1642
-{
1821
+char *ftostr12ns(const float &x) {
1643
   long xx=x*100;
1822
   long xx=x*100;
1644
   
1823
   
1645
   xx=abs(xx);
1824
   xx=abs(xx);
1799
 #ifdef MANUAL_BED_LEVELING
1978
 #ifdef MANUAL_BED_LEVELING
1800
 
1979
 
1801
   static int _lcd_level_bed_position;
1980
   static int _lcd_level_bed_position;
1981
+
1982
+  /**
1983
+   * MBL Wait for controller movement and clicks:
1984
+   *   - Movement adjusts the Z axis
1985
+   *   - Click saves the Z and goes to the next mesh point
1986
+   */
1802
   static void _lcd_level_bed() {
1987
   static void _lcd_level_bed() {
1803
     if (encoderPosition != 0) {
1988
     if (encoderPosition != 0) {
1804
       refresh_cmd_timeout();
1989
       refresh_cmd_timeout();
1844
     }
2029
     }
1845
   }
2030
   }
1846
 
2031
 
2032
+  /**
2033
+   * MBL Move to mesh starting point
2034
+   */
1847
   static void _lcd_level_bed_homing() {
2035
   static void _lcd_level_bed_homing() {
1848
     if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("XYZ"), "Homing");
2036
     if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("XYZ"), "Homing");
1849
     if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS]) {
2037
     if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS]) {
1858
     lcdDrawUpdate = 2;
2046
     lcdDrawUpdate = 2;
1859
   }
2047
   }
1860
 
2048
 
2049
+  /**
2050
+   * MBL entry-point
2051
+   */
1861
   static void lcd_level_bed() {
2052
   static void lcd_level_bed() {
1862
     axis_known_position[X_AXIS] = axis_known_position[Y_AXIS] = axis_known_position[Z_AXIS] = false;
2053
     axis_known_position[X_AXIS] = axis_known_position[Y_AXIS] = axis_known_position[Z_AXIS] = false;
1863
     mbl.reset();
2054
     mbl.reset();

Loading…
Cancel
Save