Skip to content

Commit 5fba3e0

Browse files
tombrazierthinkyhead
authored andcommitted
🩹 Fix MPC Edit Menu (MarlinFirmware#24059)
Followup to MarlinFirmware#23984 Co-authored-by: Scott Lahteine <[email protected]>
1 parent 80c090b commit 5fba3e0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Marlin/src/lcd/menu/menu_advanced.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -352,21 +352,22 @@ void menu_backlash();
352352
#define MPC_EDIT_ITEMS(N) \
353353
_MPC_EDIT_ITEMS(N); \
354354
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; \
355356
c.fan255_adjustment = editable.decimal - c.ambient_xfer_coeff_fan0; \
356357
})
357358
#else
358359
#define MPC_EDIT_ITEMS _MPC_EDIT_ITEMS
359360
#endif
360361

361362
#if HAS_MULTI_HOTEND
362-
auto mpc_edit_hotend = [&](const uint8_t e) {
363+
static auto mpc_edit_hotend = [](const uint8_t e) {
363364
MPC_EDIT_DEFS(e);
364365
START_MENU();
365366
BACK_ITEM(MSG_TEMPERATURE);
366367
MPC_EDIT_ITEMS(e);
367368
END_MENU();
368369
};
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); });
370371
#else
371372
#define MPC_ENTRY MPC_EDIT_ITEMS
372373
#endif

0 commit comments

Comments
 (0)