Power-off confirm / beep options (#22191)

This commit is contained in:
Cytown
2021-06-24 00:40:32 +08:00
committed by Scott Lahteine
parent ecb625a666
commit 9741be5966
6 changed files with 28 additions and 2 deletions

View File

@ -386,7 +386,15 @@ void menu_main() {
//
#if ENABLED(PSU_CONTROL)
if (powersupply_on)
GCODES_ITEM(MSG_SWITCH_PS_OFF, PSTR("M81"));
#if ENABLED(PS_OFF_CONFIRM)
CONFIRM_ITEM(MSG_SWITCH_PS_OFF,
MSG_YES, MSG_NO,
ui.poweroff, ui.goto_previous_screen,
GET_TEXT(MSG_SWITCH_PS_OFF), (const char *)nullptr, PSTR("?")
);
#else
GCODES_ITEM(MSG_SWITCH_PS_OFF, PSTR("M81"));
#endif
else
GCODES_ITEM(MSG_SWITCH_PS_ON, PSTR("M80"));
#endif