Browse Source

🩹 Fix MPC Edit Menu (#24059)

Followup to #23984

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

+ 3
- 2
Marlin/src/lcd/menu/menu_advanced.cpp View File

@@ -352,6 +352,7 @@ void menu_backlash();
352 352
         #define MPC_EDIT_ITEMS(N) \
353 353
           _MPC_EDIT_ITEMS(N); \
354 354
           EDIT_ITEM_FAST_N(float43, N, MSG_MPC_AMBIENT_XFER_COEFF_FAN_E, &editable.decimal, 0, 1, []{ \
355
+            MPC_t &c = thermalManager.temp_hotend[MenuItemBase::itemIndex].constants; \
355 356
             c.fan255_adjustment = editable.decimal - c.ambient_xfer_coeff_fan0; \
356 357
           })
357 358
       #else
@@ -359,14 +360,14 @@ void menu_backlash();
359 360
       #endif
360 361
 
361 362
       #if HAS_MULTI_HOTEND
362
-        auto mpc_edit_hotend = [&](const uint8_t e) {
363
+        static auto mpc_edit_hotend = [](const uint8_t e) {
363 364
           MPC_EDIT_DEFS(e);
364 365
           START_MENU();
365 366
           BACK_ITEM(MSG_TEMPERATURE);
366 367
           MPC_EDIT_ITEMS(e);
367 368
           END_MENU();
368 369
         };
369
-        #define MPC_ENTRY(N) SUBMENU_N(N, MSG_MPC_EDIT, [&]{ mpc_edit_hotend(MenuItemBase::itemIndex); });
370
+        #define MPC_ENTRY(N) SUBMENU_N(N, MSG_MPC_EDIT, []{ mpc_edit_hotend(MenuItemBase::itemIndex); });
370 371
       #else
371 372
         #define MPC_ENTRY MPC_EDIT_ITEMS
372 373
       #endif

Loading…
Cancel
Save