Explorar el Código

Move stepper settings to "Advanced Settings" menu (#13063)

Marcio Teixeira hace 5 años
padre
commit
f6edd2c472
Se han modificado 2 ficheros con 58 adiciones y 57 borrados
  1. 58
    1
      Marlin/src/lcd/menu/menu_advanced.cpp
  2. 0
    56
      Marlin/src/lcd/menu/menu_configuration.cpp

+ 58
- 1
Marlin/src/lcd/menu/menu_advanced.cpp Ver fichero

@@ -46,6 +46,53 @@
46 46
   #include "../../module/temperature.h"
47 47
 #endif
48 48
 
49
+void menu_tmc();
50
+
51
+#if ENABLED(DAC_STEPPER_CURRENT)
52
+
53
+  #include "../../feature/dac/stepper_dac.h"
54
+
55
+  uint8_t driverPercent[XYZE];
56
+  inline void dac_driver_getValues() { LOOP_XYZE(i) driverPercent[i] = dac_current_get_percent((AxisEnum)i); }
57
+  static void dac_driver_commit() { dac_current_set_percents(driverPercent); }
58
+
59
+  void menu_dac() {
60
+    dac_driver_getValues();
61
+    START_MENU();
62
+    MENU_BACK(MSG_CONTROL);
63
+    #define EDIT_DAC_PERCENT(N) MENU_ITEM_EDIT_CALLBACK(uint8, MSG_##N " " MSG_DAC_PERCENT, &driverPercent[_AXIS(N)], 0, 100, dac_driver_commit)
64
+    EDIT_DAC_PERCENT(X);
65
+    EDIT_DAC_PERCENT(Y);
66
+    EDIT_DAC_PERCENT(Z);
67
+    EDIT_DAC_PERCENT(E);
68
+    MENU_ITEM(function, MSG_DAC_EEPROM_WRITE, dac_commit_eeprom);
69
+    END_MENU();
70
+  }
71
+
72
+#endif
73
+
74
+#if HAS_MOTOR_CURRENT_PWM
75
+
76
+  #include "../../module/stepper.h"
77
+
78
+  void menu_pwm() {
79
+    START_MENU();
80
+    MENU_BACK(MSG_CONTROL);
81
+    #define EDIT_CURRENT_PWM(LABEL,I) MENU_ITEM_EDIT_CALLBACK(long5, LABEL, &stepper.motor_current_setting[I], 100, 2000, stepper.refresh_motor_power)
82
+    #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
83
+      EDIT_CURRENT_PWM(MSG_X MSG_Y, 0);
84
+    #endif
85
+    #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
86
+      EDIT_CURRENT_PWM(MSG_Z, 1);
87
+    #endif
88
+    #if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
89
+      EDIT_CURRENT_PWM(MSG_E, 2);
90
+    #endif
91
+    END_MENU();
92
+  }
93
+
94
+#endif
95
+
49 96
 #if HAS_M206_COMMAND
50 97
   //
51 98
   // Set the home offset based on the current_position
@@ -580,9 +627,19 @@ void menu_advanced_settings() {
580 627
       // M92 - Steps Per mm
581 628
       MENU_ITEM(submenu, MSG_STEPS_PER_MM, menu_advanced_steps_per_mm);
582 629
     }
583
-
584 630
   #endif // !SLIM_LCD_MENUS
585 631
 
632
+  #if ENABLED(DAC_STEPPER_CURRENT)
633
+    MENU_ITEM(submenu, MSG_DRIVE_STRENGTH, menu_dac);
634
+  #endif
635
+  #if HAS_MOTOR_CURRENT_PWM
636
+    MENU_ITEM(submenu, MSG_DRIVE_STRENGTH, menu_pwm);
637
+  #endif
638
+
639
+  #if HAS_TRINAMIC
640
+    MENU_ITEM(submenu, MSG_TMC_DRIVERS, menu_tmc);
641
+  #endif
642
+
586 643
   MENU_ITEM(submenu, MSG_TEMPERATURE, menu_advanced_temperature);
587 644
 
588 645
   #if DISABLED(NO_VOLUMETRICS) || ENABLED(ADVANCED_PAUSE_FEATURE)

+ 0
- 56
Marlin/src/lcd/menu/menu_configuration.cpp Ver fichero

@@ -48,7 +48,6 @@
48 48
 
49 49
 void menu_advanced_settings();
50 50
 void menu_delta_calibrate();
51
-void menu_tmc();
52 51
 
53 52
 static void lcd_factory_settings() {
54 53
   settings.reset();
@@ -210,51 +209,6 @@ static void lcd_factory_settings() {
210 209
 
211 210
 #endif
212 211
 
213
-#if ENABLED(DAC_STEPPER_CURRENT)
214
-
215
-  #include "../../feature/dac/stepper_dac.h"
216
-
217
-  uint8_t driverPercent[XYZE];
218
-  inline void dac_driver_getValues() { LOOP_XYZE(i) driverPercent[i] = dac_current_get_percent((AxisEnum)i); }
219
-  static void dac_driver_commit() { dac_current_set_percents(driverPercent); }
220
-
221
-  void menu_dac() {
222
-    dac_driver_getValues();
223
-    START_MENU();
224
-    MENU_BACK(MSG_CONTROL);
225
-    #define EDIT_DAC_PERCENT(N) MENU_ITEM_EDIT_CALLBACK(uint8, MSG_##N " " MSG_DAC_PERCENT, &driverPercent[_AXIS(N)], 0, 100, dac_driver_commit)
226
-    EDIT_DAC_PERCENT(X);
227
-    EDIT_DAC_PERCENT(Y);
228
-    EDIT_DAC_PERCENT(Z);
229
-    EDIT_DAC_PERCENT(E);
230
-    MENU_ITEM(function, MSG_DAC_EEPROM_WRITE, dac_commit_eeprom);
231
-    END_MENU();
232
-  }
233
-
234
-#endif
235
-
236
-#if HAS_MOTOR_CURRENT_PWM
237
-
238
-  #include "../../module/stepper.h"
239
-
240
-  void menu_pwm() {
241
-    START_MENU();
242
-    MENU_BACK(MSG_CONTROL);
243
-    #define EDIT_CURRENT_PWM(LABEL,I) MENU_ITEM_EDIT_CALLBACK(long5, LABEL, &stepper.motor_current_setting[I], 100, 2000, stepper.refresh_motor_power)
244
-    #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
245
-      EDIT_CURRENT_PWM(MSG_X MSG_Y, 0);
246
-    #endif
247
-    #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
248
-      EDIT_CURRENT_PWM(MSG_Z, 1);
249
-    #endif
250
-    #if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
251
-      EDIT_CURRENT_PWM(MSG_E, 2);
252
-    #endif
253
-    END_MENU();
254
-  }
255
-
256
-#endif
257
-
258 212
 #if DISABLED(SLIM_LCD_MENUS)
259 213
 
260 214
   void _menu_configuration_preheat_settings(const uint8_t material) {
@@ -357,16 +311,6 @@ void menu_configuration() {
357 311
   #if ENABLED(FWRETRACT)
358 312
     MENU_ITEM(submenu, MSG_RETRACT, menu_config_retract);
359 313
   #endif
360
-  #if ENABLED(DAC_STEPPER_CURRENT)
361
-    MENU_ITEM(submenu, MSG_DRIVE_STRENGTH, menu_dac);
362
-  #endif
363
-  #if HAS_MOTOR_CURRENT_PWM
364
-    MENU_ITEM(submenu, MSG_DRIVE_STRENGTH, menu_pwm);
365
-  #endif
366
-
367
-  #if HAS_TRINAMIC
368
-    MENU_ITEM(submenu, MSG_TMC_DRIVERS, menu_tmc);
369
-  #endif
370 314
 
371 315
   #if ENABLED(FILAMENT_RUNOUT_SENSOR)
372 316
     MENU_ITEM_EDIT_CALLBACK(bool, MSG_RUNOUT_SENSOR_ENABLE, &runout.enabled, runout.reset);

Loading…
Cancelar
Guardar