|
@@ -308,10 +308,6 @@ void menu_advanced_settings();
|
308
|
308
|
void _lcd_set_z_fade_height() { set_z_fade_height(lcd_z_fade_height); }
|
309
|
309
|
#endif
|
310
|
310
|
|
311
|
|
-#if ENABLED(BABYSTEPPING)
|
312
|
|
- long babysteps_done = 0;
|
313
|
|
-#endif
|
314
|
|
-
|
315
|
311
|
bool printer_busy() { return planner.movesplanned() || IS_SD_PRINTING(); }
|
316
|
312
|
|
317
|
313
|
float move_menu_scale;
|
|
@@ -740,93 +736,57 @@ void line_to_z(const float &z) {
|
740
|
736
|
|
741
|
737
|
#endif
|
742
|
738
|
|
743
|
|
-/**
|
744
|
|
- *
|
745
|
|
- * "Tune" submenu items
|
746
|
|
- *
|
747
|
|
- */
|
748
|
|
-
|
749
|
|
-#if ENABLED(BABYSTEPPING)
|
|
739
|
+#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
|
750
|
740
|
|
751
|
|
- void _lcd_babystep(const AxisEnum axis, PGM_P msg) {
|
|
741
|
+ void lcd_babystep_zoffset() {
|
752
|
742
|
if (use_click()) { return lcd_goto_previous_menu_no_defer(); }
|
|
743
|
+ defer_return_to_status = true;
|
|
744
|
+ #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
|
|
745
|
+ const bool do_probe = (active_extruder == 0);
|
|
746
|
+ #else
|
|
747
|
+ constexpr bool do_probe = true;
|
|
748
|
+ #endif
|
753
|
749
|
ENCODER_DIRECTION_NORMAL();
|
754
|
750
|
if (encoderPosition) {
|
755
|
751
|
const int16_t babystep_increment = (int32_t)encoderPosition * (BABYSTEP_MULTIPLICATOR);
|
756
|
752
|
encoderPosition = 0;
|
757
|
|
- lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
|
758
|
|
- thermalManager.babystep_axis(axis, babystep_increment);
|
759
|
|
- babysteps_done += babystep_increment;
|
760
|
|
- }
|
761
|
|
- if (lcdDrawUpdate)
|
762
|
|
- lcd_implementation_drawedit(msg, ftostr43sign(planner.steps_to_mm[axis] * babysteps_done));
|
763
|
|
- }
|
764
|
|
-
|
765
|
|
- #if ENABLED(BABYSTEP_XY)
|
766
|
|
- void _lcd_babystep_x() { _lcd_babystep(X_AXIS, PSTR(MSG_BABYSTEP_X)); }
|
767
|
|
- void _lcd_babystep_y() { _lcd_babystep(Y_AXIS, PSTR(MSG_BABYSTEP_Y)); }
|
768
|
|
- void lcd_babystep_x() { lcd_goto_screen(_lcd_babystep_x); babysteps_done = 0; defer_return_to_status = true; }
|
769
|
|
- void lcd_babystep_y() { lcd_goto_screen(_lcd_babystep_y); babysteps_done = 0; defer_return_to_status = true; }
|
770
|
|
- #endif
|
771
|
753
|
|
772
|
|
- #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
|
|
754
|
+ const float diff = planner.steps_to_mm[Z_AXIS] * babystep_increment,
|
|
755
|
+ new_probe_offset = zprobe_zoffset + diff,
|
|
756
|
+ new_offs =
|
|
757
|
+ #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
|
|
758
|
+ do_probe ? new_probe_offset : hotend_offset[Z_AXIS][active_extruder] - diff
|
|
759
|
+ #else
|
|
760
|
+ new_probe_offset
|
|
761
|
+ #endif
|
|
762
|
+ ;
|
|
763
|
+ if (WITHIN(new_offs, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) {
|
773
|
764
|
|
774
|
|
- void lcd_babystep_zoffset() {
|
775
|
|
- if (use_click()) { return lcd_goto_previous_menu_no_defer(); }
|
776
|
|
- defer_return_to_status = true;
|
777
|
|
- #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
|
778
|
|
- const bool do_probe = (active_extruder == 0);
|
779
|
|
- #else
|
780
|
|
- constexpr bool do_probe = true;
|
781
|
|
- #endif
|
782
|
|
- ENCODER_DIRECTION_NORMAL();
|
783
|
|
- if (encoderPosition) {
|
784
|
|
- const int16_t babystep_increment = (int32_t)encoderPosition * (BABYSTEP_MULTIPLICATOR);
|
785
|
|
- encoderPosition = 0;
|
786
|
|
-
|
787
|
|
- const float diff = planner.steps_to_mm[Z_AXIS] * babystep_increment,
|
788
|
|
- new_probe_offset = zprobe_zoffset + diff,
|
789
|
|
- new_offs =
|
790
|
|
- #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
|
791
|
|
- do_probe ? new_probe_offset : hotend_offset[Z_AXIS][active_extruder] - diff
|
792
|
|
- #else
|
793
|
|
- new_probe_offset
|
794
|
|
- #endif
|
795
|
|
- ;
|
796
|
|
- if (WITHIN(new_offs, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) {
|
797
|
|
-
|
798
|
|
- thermalManager.babystep_axis(Z_AXIS, babystep_increment);
|
799
|
|
-
|
800
|
|
- if (do_probe) zprobe_zoffset = new_offs;
|
801
|
|
- #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
|
802
|
|
- else hotend_offset[Z_AXIS][active_extruder] = new_offs;
|
803
|
|
- #endif
|
|
765
|
+ thermalManager.babystep_axis(Z_AXIS, babystep_increment);
|
804
|
766
|
|
805
|
|
- lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT;
|
806
|
|
- }
|
807
|
|
- }
|
808
|
|
- if (lcdDrawUpdate) {
|
|
767
|
+ if (do_probe) zprobe_zoffset = new_offs;
|
809
|
768
|
#if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
|
810
|
|
- if (!do_probe)
|
811
|
|
- lcd_implementation_drawedit(PSTR(MSG_IDEX_Z_OFFSET), ftostr43sign(hotend_offset[Z_AXIS][active_extruder]));
|
812
|
|
- else
|
|
769
|
+ else hotend_offset[Z_AXIS][active_extruder] = new_offs;
|
813
|
770
|
#endif
|
814
|
|
- lcd_implementation_drawedit(PSTR(MSG_ZPROBE_ZOFFSET), ftostr43sign(zprobe_zoffset));
|
815
|
771
|
|
816
|
|
- #if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY)
|
817
|
|
- if (do_probe) _lcd_zoffset_overlay_gfx(zprobe_zoffset);
|
818
|
|
- #endif
|
|
772
|
+ lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT;
|
819
|
773
|
}
|
820
|
774
|
}
|
|
775
|
+ if (lcdDrawUpdate) {
|
|
776
|
+ #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
|
|
777
|
+ if (!do_probe)
|
|
778
|
+ lcd_implementation_drawedit(PSTR(MSG_IDEX_Z_OFFSET), ftostr43sign(hotend_offset[Z_AXIS][active_extruder]));
|
|
779
|
+ else
|
|
780
|
+ #endif
|
|
781
|
+ lcd_implementation_drawedit(PSTR(MSG_ZPROBE_ZOFFSET), ftostr43sign(zprobe_zoffset));
|
821
|
782
|
|
822
|
|
- #else // !BABYSTEP_ZPROBE_OFFSET
|
823
|
|
-
|
824
|
|
- void _lcd_babystep_z() { _lcd_babystep(Z_AXIS, PSTR(MSG_BABYSTEP_Z)); }
|
825
|
|
- void lcd_babystep_z() { lcd_goto_screen(_lcd_babystep_z); babysteps_done = 0; defer_return_to_status = true; }
|
826
|
|
-
|
827
|
|
- #endif // !BABYSTEP_ZPROBE_OFFSET
|
|
783
|
+ #if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY)
|
|
784
|
+ if (do_probe) _lcd_zoffset_overlay_gfx(zprobe_zoffset);
|
|
785
|
+ #endif
|
|
786
|
+ }
|
|
787
|
+ }
|
828
|
788
|
|
829
|
|
-#endif // BABYSTEPPING
|
|
789
|
+#endif // BABYSTEP_ZPROBE_OFFSET
|
830
|
790
|
|
831
|
791
|
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
832
|
792
|
|
|
@@ -923,144 +883,6 @@ void watch_temp_callback_bed() {
|
923
|
883
|
#endif
|
924
|
884
|
}
|
925
|
885
|
|
926
|
|
-// Refresh the E factor after changing flow
|
927
|
|
-inline void _lcd_refresh_e_factor_0() { planner.refresh_e_factor(0); }
|
928
|
|
-#if EXTRUDERS > 1
|
929
|
|
- inline void _lcd_refresh_e_factor() { planner.refresh_e_factor(active_extruder); }
|
930
|
|
- inline void _lcd_refresh_e_factor_1() { planner.refresh_e_factor(1); }
|
931
|
|
- #if EXTRUDERS > 2
|
932
|
|
- inline void _lcd_refresh_e_factor_2() { planner.refresh_e_factor(2); }
|
933
|
|
- #if EXTRUDERS > 3
|
934
|
|
- inline void _lcd_refresh_e_factor_3() { planner.refresh_e_factor(3); }
|
935
|
|
- #if EXTRUDERS > 4
|
936
|
|
- inline void _lcd_refresh_e_factor_4() { planner.refresh_e_factor(4); }
|
937
|
|
- #if EXTRUDERS > 5
|
938
|
|
- inline void _lcd_refresh_e_factor_5() { planner.refresh_e_factor(5); }
|
939
|
|
- #endif // EXTRUDERS > 5
|
940
|
|
- #endif // EXTRUDERS > 4
|
941
|
|
- #endif // EXTRUDERS > 3
|
942
|
|
- #endif // EXTRUDERS > 2
|
943
|
|
-#endif // EXTRUDERS > 1
|
944
|
|
-
|
945
|
|
-/**
|
946
|
|
- *
|
947
|
|
- * "Tune" submenu
|
948
|
|
- *
|
949
|
|
- */
|
950
|
|
-void menu_tune() {
|
951
|
|
- START_MENU();
|
952
|
|
- MENU_BACK(MSG_MAIN);
|
953
|
|
-
|
954
|
|
- //
|
955
|
|
- // Speed:
|
956
|
|
- //
|
957
|
|
- MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999);
|
958
|
|
-
|
959
|
|
- //
|
960
|
|
- // Manual bed leveling, Bed Z:
|
961
|
|
- //
|
962
|
|
- #if ENABLED(MESH_BED_LEVELING) && ENABLED(LCD_BED_LEVELING)
|
963
|
|
- MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1);
|
964
|
|
- #endif
|
965
|
|
-
|
966
|
|
- //
|
967
|
|
- // Nozzle:
|
968
|
|
- // Nozzle [1-4]:
|
969
|
|
- //
|
970
|
|
- #if HOTENDS == 1
|
971
|
|
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0);
|
972
|
|
- #else // HOTENDS > 1
|
973
|
|
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N1, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0);
|
974
|
|
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N2, &thermalManager.target_temperature[1], 0, HEATER_1_MAXTEMP - 15, watch_temp_callback_E1);
|
975
|
|
- #if HOTENDS > 2
|
976
|
|
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N3, &thermalManager.target_temperature[2], 0, HEATER_2_MAXTEMP - 15, watch_temp_callback_E2);
|
977
|
|
- #if HOTENDS > 3
|
978
|
|
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N4, &thermalManager.target_temperature[3], 0, HEATER_3_MAXTEMP - 15, watch_temp_callback_E3);
|
979
|
|
- #if HOTENDS > 4
|
980
|
|
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N5, &thermalManager.target_temperature[4], 0, HEATER_4_MAXTEMP - 15, watch_temp_callback_E4);
|
981
|
|
- #if HOTENDS > 5
|
982
|
|
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N6, &thermalManager.target_temperature[5], 0, HEATER_5_MAXTEMP - 15, watch_temp_callback_E5);
|
983
|
|
- #endif // HOTENDS > 5
|
984
|
|
- #endif // HOTENDS > 4
|
985
|
|
- #endif // HOTENDS > 3
|
986
|
|
- #endif // HOTENDS > 2
|
987
|
|
- #endif // HOTENDS > 1
|
988
|
|
-
|
989
|
|
- //
|
990
|
|
- // Bed:
|
991
|
|
- //
|
992
|
|
- #if HAS_HEATED_BED
|
993
|
|
- MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &thermalManager.target_temperature_bed, 0, BED_MAXTEMP - 15, watch_temp_callback_bed);
|
994
|
|
- #endif
|
995
|
|
-
|
996
|
|
- //
|
997
|
|
- // Fan Speed:
|
998
|
|
- //
|
999
|
|
- #if FAN_COUNT > 0
|
1000
|
|
- #if HAS_FAN0
|
1001
|
|
- MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_FAN_SPEED FAN_SPEED_1_SUFFIX, &fan_speed[0], 0, 255);
|
1002
|
|
- #if ENABLED(EXTRA_FAN_SPEED)
|
1003
|
|
- MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED FAN_SPEED_1_SUFFIX, &new_fan_speed[0], 3, 255);
|
1004
|
|
- #endif
|
1005
|
|
- #endif
|
1006
|
|
- #if HAS_FAN1
|
1007
|
|
- MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_FAN_SPEED " 2", &fan_speed[1], 0, 255);
|
1008
|
|
- #if ENABLED(EXTRA_FAN_SPEED)
|
1009
|
|
- MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED " 2", &new_fan_speed[1], 3, 255);
|
1010
|
|
- #endif
|
1011
|
|
- #endif
|
1012
|
|
- #if HAS_FAN2
|
1013
|
|
- MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_FAN_SPEED " 3", &fan_speed[2], 0, 255);
|
1014
|
|
- #if ENABLED(EXTRA_FAN_SPEED)
|
1015
|
|
- MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED " 3", &new_fan_speed[2], 3, 255);
|
1016
|
|
- #endif
|
1017
|
|
- #endif
|
1018
|
|
- #endif // FAN_COUNT > 0
|
1019
|
|
-
|
1020
|
|
- //
|
1021
|
|
- // Flow:
|
1022
|
|
- // Flow [1-5]:
|
1023
|
|
- //
|
1024
|
|
- #if EXTRUDERS == 1
|
1025
|
|
- MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW, &planner.flow_percentage[0], 10, 999, _lcd_refresh_e_factor_0);
|
1026
|
|
- #else // EXTRUDERS > 1
|
1027
|
|
- MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW, &planner.flow_percentage[active_extruder], 10, 999, _lcd_refresh_e_factor);
|
1028
|
|
- MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N1, &planner.flow_percentage[0], 10, 999, _lcd_refresh_e_factor_0);
|
1029
|
|
- MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N2, &planner.flow_percentage[1], 10, 999, _lcd_refresh_e_factor_1);
|
1030
|
|
- #if EXTRUDERS > 2
|
1031
|
|
- MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N3, &planner.flow_percentage[2], 10, 999, _lcd_refresh_e_factor_2);
|
1032
|
|
- #if EXTRUDERS > 3
|
1033
|
|
- MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N4, &planner.flow_percentage[3], 10, 999, _lcd_refresh_e_factor_3);
|
1034
|
|
- #if EXTRUDERS > 4
|
1035
|
|
- MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N5, &planner.flow_percentage[4], 10, 999, _lcd_refresh_e_factor_4);
|
1036
|
|
- #if EXTRUDERS > 5
|
1037
|
|
- MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N6, &planner.flow_percentage[5], 10, 999, _lcd_refresh_e_factor_5);
|
1038
|
|
- #endif // EXTRUDERS > 5
|
1039
|
|
- #endif // EXTRUDERS > 4
|
1040
|
|
- #endif // EXTRUDERS > 3
|
1041
|
|
- #endif // EXTRUDERS > 2
|
1042
|
|
- #endif // EXTRUDERS > 1
|
1043
|
|
-
|
1044
|
|
- //
|
1045
|
|
- // Babystep X:
|
1046
|
|
- // Babystep Y:
|
1047
|
|
- // Babystep Z:
|
1048
|
|
- //
|
1049
|
|
- #if ENABLED(BABYSTEPPING)
|
1050
|
|
- #if ENABLED(BABYSTEP_XY)
|
1051
|
|
- MENU_ITEM(submenu, MSG_BABYSTEP_X, lcd_babystep_x);
|
1052
|
|
- MENU_ITEM(submenu, MSG_BABYSTEP_Y, lcd_babystep_y);
|
1053
|
|
- #endif
|
1054
|
|
- #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
|
1055
|
|
- MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset);
|
1056
|
|
- #else
|
1057
|
|
- MENU_ITEM(submenu, MSG_BABYSTEP_Z, lcd_babystep_z);
|
1058
|
|
- #endif
|
1059
|
|
- #endif
|
1060
|
|
-
|
1061
|
|
- END_MENU();
|
1062
|
|
-}
|
1063
|
|
-
|
1064
|
886
|
/**
|
1065
|
887
|
*
|
1066
|
888
|
* "Driver current control" submenu items
|