|
@@ -254,6 +254,38 @@ void menu_main() {
|
254
|
254
|
START_MENU();
|
255
|
255
|
BACK_ITEM(MSG_INFO_SCREEN);
|
256
|
256
|
|
|
257
|
+ #if ENABLED(SDSUPPORT)
|
|
258
|
+
|
|
259
|
+ #if !defined(MEDIA_MENU_AT_TOP) && !HAS_ENCODER_WHEEL
|
|
260
|
+ #define MEDIA_MENU_AT_TOP
|
|
261
|
+ #endif
|
|
262
|
+
|
|
263
|
+ auto sdcard_menu_items = [&]{
|
|
264
|
+ #if ENABLED(MENU_ADDAUTOSTART)
|
|
265
|
+ ACTION_ITEM(MSG_RUN_AUTO_FILES, card.autofile_begin); // Run Auto Files
|
|
266
|
+ #endif
|
|
267
|
+
|
|
268
|
+ if (card_detected) {
|
|
269
|
+ if (!card_open) {
|
|
270
|
+ #if PIN_EXISTS(SD_DETECT)
|
|
271
|
+ GCODES_ITEM(MSG_CHANGE_MEDIA, PSTR("M21")); // M21 Change Media
|
|
272
|
+ #else // - or -
|
|
273
|
+ GCODES_ITEM(MSG_RELEASE_MEDIA, PSTR("M22")); // M22 Release Media
|
|
274
|
+ #endif
|
|
275
|
+ SUBMENU(MSG_MEDIA_MENU, MEDIA_MENU_GATEWAY); // Media Menu (or Password First)
|
|
276
|
+ }
|
|
277
|
+ }
|
|
278
|
+ else {
|
|
279
|
+ #if PIN_EXISTS(SD_DETECT)
|
|
280
|
+ ACTION_ITEM(MSG_NO_MEDIA, nullptr); // "No Media"
|
|
281
|
+ #else
|
|
282
|
+ GCODES_ITEM(MSG_ATTACH_MEDIA, PSTR("M21")); // M21 Attach Media
|
|
283
|
+ #endif
|
|
284
|
+ }
|
|
285
|
+ };
|
|
286
|
+
|
|
287
|
+ #endif
|
|
288
|
+
|
257
|
289
|
if (busy) {
|
258
|
290
|
#if MACHINE_CAN_PAUSE
|
259
|
291
|
ACTION_ITEM(MSG_PAUSE_PRINT, ui.pause_print);
|
|
@@ -281,36 +313,9 @@ void menu_main() {
|
281
|
313
|
}
|
282
|
314
|
else {
|
283
|
315
|
|
284
|
|
- #if !HAS_ENCODER_WHEEL && ENABLED(SDSUPPORT)
|
285
|
|
-
|
286
|
|
- // *** IF THIS SECTION IS CHANGED, REPRODUCE BELOW ***
|
287
|
|
-
|
288
|
|
- //
|
289
|
|
- // Run Auto Files
|
290
|
|
- //
|
291
|
|
- #if ENABLED(MENU_ADDAUTOSTART)
|
292
|
|
- ACTION_ITEM(MSG_RUN_AUTO_FILES, card.autofile_begin);
|
293
|
|
- #endif
|
294
|
|
-
|
295
|
|
- if (card_detected) {
|
296
|
|
- if (!card_open) {
|
297
|
|
- SUBMENU(MSG_MEDIA_MENU, MEDIA_MENU_GATEWAY);
|
298
|
|
- #if PIN_EXISTS(SD_DETECT)
|
299
|
|
- GCODES_ITEM(MSG_CHANGE_MEDIA, PSTR("M21"));
|
300
|
|
- #else
|
301
|
|
- GCODES_ITEM(MSG_RELEASE_MEDIA, PSTR("M22"));
|
302
|
|
- #endif
|
303
|
|
- }
|
304
|
|
- }
|
305
|
|
- else {
|
306
|
|
- #if PIN_EXISTS(SD_DETECT)
|
307
|
|
- ACTION_ITEM(MSG_NO_MEDIA, nullptr);
|
308
|
|
- #else
|
309
|
|
- GCODES_ITEM(MSG_ATTACH_MEDIA, PSTR("M21"));
|
310
|
|
- #endif
|
311
|
|
- }
|
312
|
|
-
|
313
|
|
- #endif // !HAS_ENCODER_WHEEL && SDSUPPORT
|
|
316
|
+ #if BOTH(SDSUPPORT, MEDIA_MENU_AT_TOP)
|
|
317
|
+ sdcard_menu_items();
|
|
318
|
+ #endif
|
314
|
319
|
|
315
|
320
|
if (TERN0(MACHINE_CAN_PAUSE, printingIsPaused()))
|
316
|
321
|
ACTION_ITEM(MSG_RESUME_PRINT, ui.resume_print);
|
|
@@ -387,39 +392,9 @@ void menu_main() {
|
387
|
392
|
GCODES_ITEM(MSG_SWITCH_PS_ON, PSTR("M80"));
|
388
|
393
|
#endif
|
389
|
394
|
|
390
|
|
- #if BOTH(HAS_ENCODER_WHEEL, SDSUPPORT)
|
391
|
|
-
|
392
|
|
- if (!busy) {
|
393
|
|
-
|
394
|
|
- // *** IF THIS SECTION IS CHANGED, REPRODUCE ABOVE ***
|
395
|
|
-
|
396
|
|
- //
|
397
|
|
- // Autostart
|
398
|
|
- //
|
399
|
|
- #if ENABLED(MENU_ADDAUTOSTART)
|
400
|
|
- ACTION_ITEM(MSG_RUN_AUTO_FILES, card.autofile_begin);
|
401
|
|
- #endif
|
402
|
|
-
|
403
|
|
- if (card_detected) {
|
404
|
|
- if (!card_open) {
|
405
|
|
- #if PIN_EXISTS(SD_DETECT)
|
406
|
|
- GCODES_ITEM(MSG_CHANGE_MEDIA, PSTR("M21"));
|
407
|
|
- #else
|
408
|
|
- GCODES_ITEM(MSG_RELEASE_MEDIA, PSTR("M22"));
|
409
|
|
- #endif
|
410
|
|
- SUBMENU(MSG_MEDIA_MENU, MEDIA_MENU_GATEWAY);
|
411
|
|
- }
|
412
|
|
- }
|
413
|
|
- else {
|
414
|
|
- #if PIN_EXISTS(SD_DETECT)
|
415
|
|
- ACTION_ITEM(MSG_NO_MEDIA, nullptr);
|
416
|
|
- #else
|
417
|
|
- GCODES_ITEM(MSG_ATTACH_MEDIA, PSTR("M21"));
|
418
|
|
- #endif
|
419
|
|
- }
|
420
|
|
- }
|
421
|
|
-
|
422
|
|
- #endif // HAS_ENCODER_WHEEL && SDSUPPORT
|
|
395
|
+ #if ENABLED(SDSUPPORT) && DISABLED(MEDIA_MENU_AT_TOP)
|
|
396
|
+ sdcard_menu_items();
|
|
397
|
+ #endif
|
423
|
398
|
|
424
|
399
|
#if HAS_SERVICE_INTERVALS
|
425
|
400
|
static auto _service_reset = [](const int index) {
|