From cf567686df8a059b18649fccd1542ed2d1c76768 Mon Sep 17 00:00:00 2001 From: tombrazier <68918209+tombrazier@users.noreply.github.com> Date: Fri, 22 Apr 2022 07:50:38 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20MPC=20Edit=20Menu=20(#2405?= =?UTF-8?q?9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #23984 Co-authored-by: Scott Lahteine --- Marlin/src/lcd/menu/menu_advanced.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index efc86025f790..214ff133b2b8 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -352,6 +352,7 @@ void menu_backlash(); #define MPC_EDIT_ITEMS(N) \ _MPC_EDIT_ITEMS(N); \ EDIT_ITEM_FAST_N(float43, N, MSG_MPC_AMBIENT_XFER_COEFF_FAN_E, &editable.decimal, 0, 1, []{ \ + MPC_t &c = thermalManager.temp_hotend[MenuItemBase::itemIndex].constants; \ c.fan255_adjustment = editable.decimal - c.ambient_xfer_coeff_fan0; \ }) #else @@ -359,14 +360,14 @@ void menu_backlash(); #endif #if HAS_MULTI_HOTEND - auto mpc_edit_hotend = [&](const uint8_t e) { + static auto mpc_edit_hotend = [](const uint8_t e) { MPC_EDIT_DEFS(e); START_MENU(); BACK_ITEM(MSG_TEMPERATURE); MPC_EDIT_ITEMS(e); END_MENU(); }; - #define MPC_ENTRY(N) SUBMENU_N(N, MSG_MPC_EDIT, [&]{ mpc_edit_hotend(MenuItemBase::itemIndex); }); + #define MPC_ENTRY(N) SUBMENU_N(N, MSG_MPC_EDIT, []{ mpc_edit_hotend(MenuItemBase::itemIndex); }); #else #define MPC_ENTRY MPC_EDIT_ITEMS #endif