Browse Source

Merge remote-tracking branch 'origin/Marlin_v1' into Marlin_v1

Conflicts:
	Marlin/Configuration.h
	Marlin/Marlin.pde
Erik van der Zalm 13 years ago
parent
commit
e63e224a33
7 changed files with 42 additions and 18 deletions
  1. 3
    2
      Marlin/Configuration.h
  2. 1
    1
      Marlin/Marlin.h
  3. 10
    1
      Marlin/Marlin.pde
  4. 1
    0
      Marlin/cardreader.h
  5. 2
    2
      Marlin/ultralcd.h
  6. 23
    12
      Marlin/ultralcd.pde
  7. 2
    0
      Marlin/watchdog.pde

+ 3
- 2
Marlin/Configuration.h View File

58
 //#define BED_USES_THERMISTOR
58
 //#define BED_USES_THERMISTOR
59
 //#define BED_USES_AD595
59
 //#define BED_USES_AD595
60
 
60
 
61
-#define HEATER_CHECK_INTERVAL 50 //ms
62
 #define BED_CHECK_INTERVAL 5000 //ms
61
 #define BED_CHECK_INTERVAL 5000 //ms
63
 
62
 
64
 //// Experimental watchdog and minimal temp
63
 //// Experimental watchdog and minimal temp
243
 // The watchdog waits for the watchperiod in milliseconds whenever an M104 or M109 increases the target temperature
242
 // The watchdog waits for the watchperiod in milliseconds whenever an M104 or M109 increases the target temperature
244
 // this enables the watchdog interrupt.
243
 // this enables the watchdog interrupt.
245
 //#define USE_WATCHDOG
244
 //#define USE_WATCHDOG
246
-// you cannot reboot on a mega2560 due to a bug in he bootloader. Hence, you have to reset manually, and this is done hereby:
245
+#ifdef USE_WATCHDOG
246
+  // you cannot reboot on a mega2560 due to a bug in he bootloader. Hence, you have to reset manually, and this is done hereby:
247
 //#define RESET_MANUAL
247
 //#define RESET_MANUAL
248
 //#define WATCHDOG_TIMEOUT 4  //seconds
248
 //#define WATCHDOG_TIMEOUT 4  //seconds
249
 
249
 
250
+
250
 // extruder advance constant (s2/mm3)
251
 // extruder advance constant (s2/mm3)
251
 //
252
 //
252
 // advance (steps) = STEPS_PER_CUBIC_MM_E * EXTUDER_ADVANCE_K * cubic mm per second ^ 2
253
 // advance (steps) = STEPS_PER_CUBIC_MM_E * EXTUDER_ADVANCE_K * cubic mm per second ^ 2

+ 1
- 1
Marlin/Marlin.h View File

100
 void kill();
100
 void kill();
101
 
101
 
102
 void enquecommand(const char *cmd); //put an ascii command at the end of the current buffer.
102
 void enquecommand(const char *cmd); //put an ascii command at the end of the current buffer.
103
-
103
+void prepare_arc_move(char isclockwise);
104
 
104
 
105
 #ifndef CRITICAL_SECTION_START
105
 #ifndef CRITICAL_SECTION_START
106
   #define CRITICAL_SECTION_START  unsigned char _sreg = SREG; cli();
106
   #define CRITICAL_SECTION_START  unsigned char _sreg = SREG; cli();

+ 10
- 1
Marlin/Marlin.pde View File

37
 #include "temperature.h"
37
 #include "temperature.h"
38
 #include "motion_control.h"
38
 #include "motion_control.h"
39
 #include "cardreader.h"
39
 #include "cardreader.h"
40
+#include "watchdog.h"
40
 
41
 
41
 
42
 
42
 #define VERSION_STRING  "1.0.0 Alpha 1"
43
 #define VERSION_STRING  "1.0.0 Alpha 1"
193
 }
194
 }
194
 
195
 
195
 
196
 
197
+
198
+
199
+
200
+
201
+
202
+
196
 //adds an command to the main command buffer
203
 //adds an command to the main command buffer
197
 //thats really done in a non-safe way.
204
 //thats really done in a non-safe way.
198
 //needs overworking someday
205
 //needs overworking someday
235
   tp_init();    // Initialize temperature loop 
242
   tp_init();    // Initialize temperature loop 
236
   plan_init();  // Initialize planner;
243
   plan_init();  // Initialize planner;
237
   st_init();    // Initialize stepper;
244
   st_init();    // Initialize stepper;
245
+  wd_init();
238
 }
246
 }
239
 
247
 
240
 
248
 
659
       break;
667
       break;
660
     case 105: // M105
668
     case 105: // M105
661
       //SERIAL_ECHOLN(freeMemory());
669
       //SERIAL_ECHOLN(freeMemory());
662
-          
670
+       //test watchdog:
671
+       //delay(20000);
663
       #if (TEMP_0_PIN > -1) || defined (HEATER_USES_AD595)
672
       #if (TEMP_0_PIN > -1) || defined (HEATER_USES_AD595)
664
         SERIAL_PROTOCOLPGM("ok T:");
673
         SERIAL_PROTOCOLPGM("ok T:");
665
         SERIAL_PROTOCOL( degHotend0()); 
674
         SERIAL_PROTOCOL( degHotend0()); 

+ 1
- 0
Marlin/cardreader.h View File

33
   inline bool eof() { return sdpos>=filesize ;};
33
   inline bool eof() { return sdpos>=filesize ;};
34
   inline int16_t get() {  sdpos = file.curPosition();return (int16_t)file.read();};
34
   inline int16_t get() {  sdpos = file.curPosition();return (int16_t)file.read();};
35
   inline void setIndex(long index) {sdpos = index;file.seekSet(index);};
35
   inline void setIndex(long index) {sdpos = index;file.seekSet(index);};
36
+  inline uint8_t percentDone(){if(!sdprinting) return 0; if(filesize) return sdpos*100/filesize; else return 0;};
36
 
37
 
37
 public:
38
 public:
38
   bool saving;
39
   bool saving;

+ 2
- 2
Marlin/ultralcd.h View File

97
   #define BLOCK ;
97
   #define BLOCK ;
98
 #endif 
98
 #endif 
99
   
99
   
100
-  
100
+void lcd_statuspgm(const char* message);
101
   
101
   
102
 #endif //ULTRALCD
102
 #endif //ULTRALCD
103
-
103
+

+ 23
- 12
Marlin/ultralcd.pde View File

374
     lcd.print(fillto(LCD_WIDTH,messagetext));
374
     lcd.print(fillto(LCD_WIDTH,messagetext));
375
     messagetext[0]='\0';
375
     messagetext[0]='\0';
376
   }
376
   }
377
+  
378
+  static uint8_t oldpercent=101;
379
+  uint8_t percent=card.percentDone();
380
+  if(oldpercent!=percent ||force_lcd_update)
381
+  {
382
+     lcd.setCursor(7,2);
383
+    lcd.print(itostr3((int)percent));
384
+    lcdprintPGM("%SD");
385
+    
386
+  }
387
+  
377
 #else //smaller LCDS----------------------------------
388
 #else //smaller LCDS----------------------------------
378
   static int olddegHotEnd0=-1;
389
   static int olddegHotEnd0=-1;
379
   static int oldtargetHotEnd0=-1;
390
   static int oldtargetHotEnd0=-1;
686
       if(force_lcd_update)
697
       if(force_lcd_update)
687
         {
698
         {
688
           lcd.setCursor(0,line);lcdprintPGM(" Vxy-jerk: ");
699
           lcd.setCursor(0,line);lcdprintPGM(" Vxy-jerk: ");
689
-          lcd.setCursor(13,line);lcd.print(itostr3(max_xy_jerk/60));
700
+          lcd.setCursor(13,line);lcd.print(itostr3(max_xy_jerk));
690
         }
701
         }
691
         
702
         
692
         if((activeline==line) )
703
         if((activeline==line) )
696
             linechanging=!linechanging;
707
             linechanging=!linechanging;
697
             if(linechanging)
708
             if(linechanging)
698
             {
709
             {
699
-               encoderpos=(int)max_xy_jerk/60;
710
+               encoderpos=(int)max_xy_jerk;
700
             }
711
             }
701
             else
712
             else
702
             {
713
             {
703
-              max_xy_jerk= encoderpos*60;
714
+              max_xy_jerk= encoderpos;
704
               encoderpos=activeline*lcdslow;
715
               encoderpos=activeline*lcdslow;
705
                 
716
                 
706
             }
717
             }
866
           if(i==ItemC_vmaxy)lcdprintPGM("y:");
877
           if(i==ItemC_vmaxy)lcdprintPGM("y:");
867
           if(i==ItemC_vmaxz)lcdprintPGM("z:");
878
           if(i==ItemC_vmaxz)lcdprintPGM("z:");
868
           if(i==ItemC_vmaxe)lcdprintPGM("e:");
879
           if(i==ItemC_vmaxe)lcdprintPGM("e:");
869
-          lcd.setCursor(13,line);lcd.print(itostr3(max_feedrate[i-ItemC_vmaxx]/60));
880
+          lcd.setCursor(13,line);lcd.print(itostr3(max_feedrate[i-ItemC_vmaxx]));
870
         }
881
         }
871
         
882
         
872
         if((activeline==line) )
883
         if((activeline==line) )
876
             linechanging=!linechanging;
887
             linechanging=!linechanging;
877
             if(linechanging)
888
             if(linechanging)
878
             {
889
             {
879
-               encoderpos=(int)max_feedrate[i-ItemC_vmaxx]/60;
890
+               encoderpos=(int)max_feedrate[i-ItemC_vmaxx];
880
             }
891
             }
881
             else
892
             else
882
             {
893
             {
883
-              max_feedrate[i-ItemC_vmaxx]= encoderpos*60;
894
+              max_feedrate[i-ItemC_vmaxx]= encoderpos;
884
               encoderpos=activeline*lcdslow;
895
               encoderpos=activeline*lcdslow;
885
                 
896
                 
886
             }
897
             }
901
       if(force_lcd_update)
912
       if(force_lcd_update)
902
         {
913
         {
903
           lcd.setCursor(0,line);lcdprintPGM(" Vmin:");
914
           lcd.setCursor(0,line);lcdprintPGM(" Vmin:");
904
-          lcd.setCursor(13,line);lcd.print(itostr3(minimumfeedrate/60));
915
+          lcd.setCursor(13,line);lcd.print(itostr3(minimumfeedrate));
905
         }
916
         }
906
         
917
         
907
         if((activeline==line) )
918
         if((activeline==line) )
911
             linechanging=!linechanging;
922
             linechanging=!linechanging;
912
             if(linechanging)
923
             if(linechanging)
913
             {
924
             {
914
-               encoderpos=(int)(minimumfeedrate/60.);
925
+               encoderpos=(int)(minimumfeedrate);
915
             }
926
             }
916
             else
927
             else
917
             {
928
             {
918
-              minimumfeedrate= encoderpos*60;
929
+              minimumfeedrate= encoderpos;
919
               encoderpos=activeline*lcdslow;
930
               encoderpos=activeline*lcdslow;
920
                 
931
                 
921
             }
932
             }
935
       if(force_lcd_update)
946
       if(force_lcd_update)
936
         {
947
         {
937
           lcd.setCursor(0,line);lcdprintPGM(" VTrav min:");
948
           lcd.setCursor(0,line);lcdprintPGM(" VTrav min:");
938
-          lcd.setCursor(13,line);lcd.print(itostr3(mintravelfeedrate/60));
949
+          lcd.setCursor(13,line);lcd.print(itostr3(mintravelfeedrate));
939
         }
950
         }
940
         
951
         
941
         if((activeline==line) )
952
         if((activeline==line) )
945
             linechanging=!linechanging;
956
             linechanging=!linechanging;
946
             if(linechanging)
957
             if(linechanging)
947
             {
958
             {
948
-               encoderpos=(int)mintravelfeedrate/60;
959
+               encoderpos=(int)mintravelfeedrate;
949
             }
960
             }
950
             else
961
             else
951
             {
962
             {
952
-              mintravelfeedrate= encoderpos*60;
963
+              mintravelfeedrate= encoderpos;
953
               encoderpos=activeline*lcdslow;
964
               encoderpos=activeline*lcdslow;
954
                 
965
                 
955
             }
966
             }

+ 2
- 0
Marlin/watchdog.pde View File

42
  
42
  
43
     #ifdef RESET_MANUAL
43
     #ifdef RESET_MANUAL
44
       LCD_MESSAGEPGM("Please Reset!");
44
       LCD_MESSAGEPGM("Please Reset!");
45
+      LCD_STATUS;
45
       SERIAL_ERROR_START;
46
       SERIAL_ERROR_START;
46
       SERIAL_ERRORLNPGM("Something is wrong, please turn off the printer.");
47
       SERIAL_ERRORLNPGM("Something is wrong, please turn off the printer.");
47
     #else
48
     #else
48
       LCD_MESSAGEPGM("Timeout, resetting!");
49
       LCD_MESSAGEPGM("Timeout, resetting!");
50
+      LCD_STATUS;
49
     #endif 
51
     #endif 
50
     //disable watchdog, it will survife reboot.
52
     //disable watchdog, it will survife reboot.
51
     WDTCSR |= (1<<WDCE) | (1<<WDE);
53
     WDTCSR |= (1<<WDCE) | (1<<WDE);

Loading…
Cancel
Save