Browse Source

Fix compile with DISTINCT_E_FACTORS + SLIM_LCD_MENUS (#21733)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
lujios 3 years ago
parent
commit
4e4c3ef8fc
No account linked to committer's email address
1 changed files with 11 additions and 12 deletions
  1. 11
    12
      Marlin/src/lcd/menu/menu_advanced.cpp

+ 11
- 12
Marlin/src/lcd/menu/menu_advanced.cpp View File

@@ -350,16 +350,6 @@ void menu_backlash();
350 350
 
351 351
 #if DISABLED(SLIM_LCD_MENUS)
352 352
 
353
-  #if ENABLED(DISTINCT_E_FACTORS)
354
-    inline void _reset_e_acceleration_rate(const uint8_t e) { if (e == active_extruder) planner.reset_acceleration_rates(); }
355
-    inline void _planner_refresh_e_positioning(const uint8_t e) {
356
-      if (e == active_extruder)
357
-        planner.refresh_positioning();
358
-      else
359
-        planner.steps_to_mm[E_AXIS_N(e)] = 1.0f / planner.settings.axis_steps_per_mm[E_AXIS_N(e)];
360
-    }
361
-  #endif
362
-
363 353
   // M203 / M205 Velocity options
364 354
   void menu_advanced_velocity() {
365 355
     // M203 Max Feedrate
@@ -443,7 +433,10 @@ void menu_backlash();
443 433
     #if ENABLED(DISTINCT_E_FACTORS)
444 434
       EDIT_ITEM_FAST(long5_25, MSG_AMAX_E, &planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(active_extruder)], 100, max_accel_edit_scaled.e, []{ planner.reset_acceleration_rates(); });
445 435
       LOOP_L_N(n, E_STEPPERS)
446
-        EDIT_ITEM_FAST_N(long5_25, n, MSG_AMAX_EN, &planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(n)], 100, max_accel_edit_scaled.e, []{ _reset_e_acceleration_rate(MenuItemBase::itemIndex); });
436
+        EDIT_ITEM_FAST_N(long5_25, n, MSG_AMAX_EN, &planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(n)], 100, max_accel_edit_scaled.e, []{
437
+          if (MenuItemBase::itemIndex == active_extruder)
438
+            planner.reset_acceleration_rates();
439
+       });
447 440
     #elif E_STEPPERS
448 441
       EDIT_ITEM_FAST(long5_25, MSG_AMAX_E, &planner.settings.max_acceleration_mm_per_s2[E_AXIS], 100, max_accel_edit_scaled.e, []{ planner.reset_acceleration_rates(); });
449 442
     #endif
@@ -530,7 +523,13 @@ void menu_advanced_steps_per_mm() {
530 523
 
531 524
   #if ENABLED(DISTINCT_E_FACTORS)
532 525
     LOOP_L_N(n, E_STEPPERS)
533
-      EDIT_ITEM_FAST_N(float51, n, MSG_EN_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(n)], 5, 9999, []{ _planner_refresh_e_positioning(MenuItemBase::itemIndex); });
526
+      EDIT_ITEM_FAST_N(float51, n, MSG_EN_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(n)], 5, 9999, []{
527
+        const uint8_t e = MenuItemBase::itemIndex;
528
+        if (e == active_extruder)
529
+          planner.refresh_positioning();
530
+        else
531
+          planner.steps_to_mm[E_AXIS_N(e)] = 1.0f / planner.settings.axis_steps_per_mm[E_AXIS_N(e)];
532
+      });
534 533
   #elif E_STEPPERS
535 534
     EDIT_ITEM_FAST(float51, MSG_E_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS], 5, 9999, []{ planner.refresh_positioning(); });
536 535
   #endif

Loading…
Cancel
Save