Преглед изворни кода

added autostart procedure trigger to the ultralcd menu

Bernhard пре 13 година
родитељ
комит
cc4a9cdb69
3 измењених фајлова са 15 додато и 7 уклоњено
  1. 1
    0
      Marlin/cardreader.h
  2. 4
    2
      Marlin/cardreader.pde
  3. 10
    5
      Marlin/ultralcd.pde

+ 1
- 0
Marlin/cardreader.h Прегледај датотеку

@@ -44,6 +44,7 @@ public:
44 44
   bool cardOK ;
45 45
   char filename[11];
46 46
   bool filenameIsDir;
47
+  int lastnr; //last number of the autostart;
47 48
 private:
48 49
   SdFile root,*curDir,workDir,workDirParent,workDirParentParent;
49 50
   Sd2Card card;

+ 4
- 2
Marlin/cardreader.pde Прегледај датотеку

@@ -14,6 +14,7 @@ CardReader::CardReader()
14 14
    autostart_atmillis=0;
15 15
 
16 16
    autostart_stilltocheck=true; //the sd start is delayed, because otherwise the serial cannot answer fast enought to make contact with the hostsoftware.
17
+   lastnr=0;
17 18
   //power to SD reader
18 19
   #if SDPOWER > -1
19 20
     SET_OUTPUT(SDPOWER); 
@@ -334,7 +335,7 @@ void CardReader::checkautostart(bool force)
334 335
     if(!cardOK) //fail
335 336
       return;
336 337
   }
337
-  static int lastnr=0;
338
+  
338 339
   char autoname[30];
339 340
   sprintf(autoname,"auto%i.g",lastnr);
340 341
   for(int8_t i=0;i<(int)strlen(autoname);i++)
@@ -434,7 +435,8 @@ void CardReader::printingHasFinished()
434 435
  sdprinting = false;
435 436
  if(SD_FINISHED_STEPPERRELEASE)
436 437
  {
437
-   finishAndDisableSteppers();
438
+   //finishAndDisableSteppers();
439
+   enquecommand("M84");
438 440
  }
439 441
  autotempShutdown();
440 442
 }

+ 10
- 5
Marlin/ultralcd.pde Прегледај датотеку

@@ -437,7 +437,7 @@ void MainMenu::showStatus()
437 437
   force_lcd_update=false;
438 438
 }
439 439
 
440
-enum {ItemP_exit, ItemP_home, ItemP_origin, ItemP_preheat, ItemP_extrude, ItemP_disstep};
440
+enum {ItemP_exit, ItemP_autostart,ItemP_disstep,ItemP_home, ItemP_origin, ItemP_preheat, ItemP_extrude};
441 441
 
442 442
 //any action must not contain a ',' character anywhere, or this breaks:
443 443
 #define MENUITEM(repaint_action, click_action) \
@@ -458,6 +458,12 @@ void MainMenu::showPrepare()
458 458
     case ItemP_exit:
459 459
       MENUITEM(  lcdprintPGM(" Main \003")  ,  BLOCK;status=Main_Menu;beepshort(); ) ;
460 460
       break;
461
+    case ItemP_autostart:
462
+      MENUITEM(  lcdprintPGM(" Autostart")  ,  BLOCK;card.lastnr=0;card.checkautostart(true);beepshort(); ) ;
463
+      break;
464
+    case ItemP_disstep:
465
+      MENUITEM(  lcdprintPGM(" Disable Steppers")  ,  BLOCK;enquecommand("M84");beepshort(); ) ;
466
+      break;
461 467
     case ItemP_home:
462 468
       MENUITEM(  lcdprintPGM(" Auto Home")  ,  BLOCK;enquecommand("G28 X-105 Y-105 Z0");beepshort(); ) ;
463 469
       break;
@@ -470,15 +476,14 @@ void MainMenu::showPrepare()
470 476
     case ItemP_extrude:
471 477
       MENUITEM(  lcdprintPGM(" Extrude")  ,  BLOCK;enquecommand("G92 E0");enquecommand("G1 F700 E50");beepshort(); ) ;
472 478
       break;
473
-    case ItemP_disstep:
474
-      MENUITEM(  lcdprintPGM(" Disable Steppers")  ,  BLOCK;enquecommand("M84");beepshort(); ) ;
475
-      break;
479
+    
480
+    
476 481
     default:   
477 482
       break;
478 483
   }
479 484
   line++;
480 485
  }
481
- updateActiveLines(ItemP_disstep,encoderpos);
486
+ updateActiveLines(ItemP_extrude,encoderpos);
482 487
 }
483 488
 
484 489
 enum {ItemT_exit,ItemT_speed,ItemT_flow,ItemT_nozzle,ItemT_fan};

Loading…
Откажи
Сачувај