@@ -233,12 +233,11 @@ void menu_configuration();
233233#endif
234234
235235void menu_main () {
236- const bool busy = printingIsActive ()
237- #if HAS_MEDIA
238- , card_detected = card.isMounted ()
239- , card_open = card_detected && card.isFileOpen ()
240- #endif
241- ;
236+ const bool busy = printingIsActive ();
237+ #if HAS_MEDIA
238+ const bool card_detected = card.isMounted (),
239+ card_open = card_detected && card.isFileOpen ();
240+ #endif
242241
243242 START_MENU ();
244243 BACK_ITEM (MSG_INFO_SCREEN);
@@ -275,12 +274,12 @@ void menu_main() {
275274 else {
276275 #if ALL(HAS_MEDIA, MEDIA_MENU_AT_TOP)
277276 // BEGIN MEDIA MENU
278- #if ENABLED(MENU_ADDAUTOSTART)
279- ACTION_ITEM (MSG_RUN_AUTO_FILES, card.autofile_begin ); // Run Auto Files
280- #endif
281-
282277 if (card_detected) {
283278 if (!card_open) {
279+ #if ENABLED(MENU_ADDAUTOSTART)
280+ ACTION_ITEM (MSG_RUN_AUTO_FILES, card.autofile_begin ); // Run Auto Files
281+ #endif
282+
284283 #if HAS_SD_DETECT
285284 GCODES_ITEM (MSG_CHANGE_MEDIA, F (" M21" TERN_ (MULTI_VOLUME, " S" ))); // M21 Change Media
286285 #if ENABLED(MULTI_VOLUME)
@@ -392,12 +391,12 @@ void menu_main() {
392391
393392 #if HAS_MEDIA && DISABLED(MEDIA_MENU_AT_TOP)
394393 // BEGIN MEDIA MENU
395- #if ENABLED(MENU_ADDAUTOSTART)
396- ACTION_ITEM (MSG_RUN_AUTO_FILES, card.autofile_begin ); // Run Auto Files
397- #endif
398-
399394 if (card_detected) {
400395 if (!card_open) {
396+ #if ENABLED(MENU_ADDAUTOSTART)
397+ ACTION_ITEM (MSG_RUN_AUTO_FILES, card.autofile_begin ); // Run Auto Files
398+ #endif
399+
401400 #if HAS_SD_DETECT
402401 GCODES_ITEM (MSG_CHANGE_MEDIA, F (" M21" TERN_ (MULTI_VOLUME, " S" ))); // M21 Change Media
403402 #if ENABLED(MULTI_VOLUME)
0 commit comments