Browse Source

added autostart procedure trigger to the ultralcd menu

Bernhard 13 years ago
parent
commit
cc4a9cdb69
3 changed files with 15 additions and 7 deletions
  1. 1
    0
      Marlin/cardreader.h
  2. 4
    2
      Marlin/cardreader.pde
  3. 10
    5
      Marlin/ultralcd.pde

+ 1
- 0
Marlin/cardreader.h View File

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

+ 4
- 2
Marlin/cardreader.pde View File

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

+ 10
- 5
Marlin/ultralcd.pde View File

437
   force_lcd_update=false;
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
 //any action must not contain a ',' character anywhere, or this breaks:
442
 //any action must not contain a ',' character anywhere, or this breaks:
443
 #define MENUITEM(repaint_action, click_action) \
443
 #define MENUITEM(repaint_action, click_action) \
458
     case ItemP_exit:
458
     case ItemP_exit:
459
       MENUITEM(  lcdprintPGM(" Main \003")  ,  BLOCK;status=Main_Menu;beepshort(); ) ;
459
       MENUITEM(  lcdprintPGM(" Main \003")  ,  BLOCK;status=Main_Menu;beepshort(); ) ;
460
       break;
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
     case ItemP_home:
467
     case ItemP_home:
462
       MENUITEM(  lcdprintPGM(" Auto Home")  ,  BLOCK;enquecommand("G28 X-105 Y-105 Z0");beepshort(); ) ;
468
       MENUITEM(  lcdprintPGM(" Auto Home")  ,  BLOCK;enquecommand("G28 X-105 Y-105 Z0");beepshort(); ) ;
463
       break;
469
       break;
470
     case ItemP_extrude:
476
     case ItemP_extrude:
471
       MENUITEM(  lcdprintPGM(" Extrude")  ,  BLOCK;enquecommand("G92 E0");enquecommand("G1 F700 E50");beepshort(); ) ;
477
       MENUITEM(  lcdprintPGM(" Extrude")  ,  BLOCK;enquecommand("G92 E0");enquecommand("G1 F700 E50");beepshort(); ) ;
472
       break;
478
       break;
473
-    case ItemP_disstep:
474
-      MENUITEM(  lcdprintPGM(" Disable Steppers")  ,  BLOCK;enquecommand("M84");beepshort(); ) ;
475
-      break;
479
+    
480
+    
476
     default:   
481
     default:   
477
       break;
482
       break;
478
   }
483
   }
479
   line++;
484
   line++;
480
  }
485
  }
481
- updateActiveLines(ItemP_disstep,encoderpos);
486
+ updateActiveLines(ItemP_extrude,encoderpos);
482
 }
487
 }
483
 
488
 
484
 enum {ItemT_exit,ItemT_speed,ItemT_flow,ItemT_nozzle,ItemT_fan};
489
 enum {ItemT_exit,ItemT_speed,ItemT_flow,ItemT_nozzle,ItemT_fan};

Loading…
Cancel
Save