Browse Source

make an option if sd-card stop should release the steppers.

Bernhard 13 years ago
parent
commit
6d6f323535
4 changed files with 15 additions and 2 deletions
  1. 1
    0
      Marlin/Configuration.h
  2. 2
    1
      Marlin/cardreader.h
  3. 11
    0
      Marlin/cardreader.pde
  4. 1
    1
      Marlin/ultralcd.pde

+ 1
- 0
Marlin/Configuration.h View File

281
 //LCD and SD support
281
 //LCD and SD support
282
 //#define ULTRA_LCD  //general lcd support, also 16x2
282
 //#define ULTRA_LCD  //general lcd support, also 16x2
283
 //#define SDSUPPORT // Enable SD Card Support in Hardware Console
283
 //#define SDSUPPORT // Enable SD Card Support in Hardware Console
284
+#define SD_FINISHED_STEPPERRELEASE true  //if sd support and the file is finished: disable steppers?
284
 
285
 
285
 //#define ULTIPANEL
286
 //#define ULTIPANEL
286
 #ifdef ULTIPANEL
287
 #ifdef ULTIPANEL

+ 2
- 1
Marlin/cardreader.h View File

2
 #define __CARDREADERH
2
 #define __CARDREADERH
3
 
3
 
4
 #ifdef SDSUPPORT
4
 #ifdef SDSUPPORT
5
- 
5
+
6
 #include "SdFile.h"
6
 #include "SdFile.h"
7
 enum LsAction {LS_SerialPrint,LS_Count,LS_GetFilename};
7
 enum LsAction {LS_SerialPrint,LS_Count,LS_GetFilename};
8
 class CardReader
8
 class CardReader
22
   void startFileprint();
22
   void startFileprint();
23
   void pauseSDPrint();
23
   void pauseSDPrint();
24
   void getStatus();
24
   void getStatus();
25
+  void printingHasFinished();
25
 
26
 
26
   void getfilename(const uint8_t nr);
27
   void getfilename(const uint8_t nr);
27
   uint16_t getnrfilenames();
28
   uint16_t getnrfilenames();

+ 11
- 0
Marlin/cardreader.pde View File

2
 //#include <unistd.h>
2
 //#include <unistd.h>
3
 #ifdef SDSUPPORT
3
 #ifdef SDSUPPORT
4
 
4
 
5
+#include "Configuration.h"
6
+
5
 CardReader::CardReader()
7
 CardReader::CardReader()
6
 {
8
 {
7
    filesize = 0;
9
    filesize = 0;
426
   }
428
   }
427
 }
429
 }
428
 
430
 
431
+
432
+void CardReader::printingHasFinished()
433
+{
434
+ sdprinting = false;
435
+ if(SD_FINISHED_STEPPERRELEASE)
436
+ {
437
+   finishAndDisableSteppers();
438
+ }
439
+}
429
 #endif //SDSUPPORT
440
 #endif //SDSUPPORT

+ 1
- 1
Marlin/ultralcd.pde View File

1471
         #endif
1471
         #endif
1472
         if((activeline==line)&&CLICKED)
1472
         if((activeline==line)&&CLICKED)
1473
         {
1473
         {
1474
-          card.sdprinting = false;
1474
+          card.printingHasFinished();
1475
           BLOCK;
1475
           BLOCK;
1476
           status=Main_SD;
1476
           status=Main_SD;
1477
           beepshort();
1477
           beepshort();

Loading…
Cancel
Save