diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index efc86025f7..214ff133b2 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