Browse Source

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

Erik van der Zalm 13 years ago
parent
commit
95a0b28acb

+ 1
- 0
Marlin/Configuration.h View File

214
 #define X_HOME_RETRACT_MM 5 
214
 #define X_HOME_RETRACT_MM 5 
215
 #define Y_HOME_RETRACT_MM 5 
215
 #define Y_HOME_RETRACT_MM 5 
216
 #define Z_HOME_RETRACT_MM 1 
216
 #define Z_HOME_RETRACT_MM 1 
217
+#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
217
 
218
 
218
 #define AXIS_RELATIVE_MODES {false, false, false, false}
219
 #define AXIS_RELATIVE_MODES {false, false, false, false}
219
 
220
 

+ 15
- 6
Marlin/Marlin.h View File

16
 #include "Configuration.h"
16
 #include "Configuration.h"
17
 #include "MarlinSerial.h"
17
 #include "MarlinSerial.h"
18
 
18
 
19
-
20
 #define  FORCE_INLINE __attribute__((always_inline)) inline
19
 #define  FORCE_INLINE __attribute__((always_inline)) inline
21
 //#define SERIAL_ECHO(x) Serial << "echo: " << x;
20
 //#define SERIAL_ECHO(x) Serial << "echo: " << x;
22
 //#define SERIAL_ECHOLN(x) Serial << "echo: "<<x<<endl;
21
 //#define SERIAL_ECHOLN(x) Serial << "echo: "<<x<<endl;
25
 //#define SERIAL_PROTOCOL(x) Serial << x;
24
 //#define SERIAL_PROTOCOL(x) Serial << x;
26
 //#define SERIAL_PROTOCOLLN(x) Serial << x<<endl;
25
 //#define SERIAL_PROTOCOLLN(x) Serial << x<<endl;
27
 
26
 
27
+//this is a unfinsihed attemp to removes a lot of warning messages, see:
28
+// http://www.avrfreaks.net/index.php?name=PNphpBB2&file=printview&t=57011
29
+//typedef char prog_char PROGMEM; 
30
+// //#define PSTR    (s )        ((const PROGMEM char *)(s))
31
+// //# define MYPGM(s) (__extension__({static prog_char __c[] = (s); &__c[0];})) 
32
+// //#define MYPGM(s) ((const prog_char *g PROGMEM=s))
33
+// //#define MYPGM(s) PSTR(s)
34
+#define MYPGM(s)  (__extension__({static char __c[] __attribute__((__progmem__)) = (s); &__c[0];}))  //This is the normal behaviour
35
+//#define MYPGM(s)  (__extension__({static prog_char __c[]  = (s); &__c[0];})) //this does not work but hides the warnings
28
 
36
 
29
 
37
 
30
 #define SERIAL_PROTOCOL(x) MSerial.print(x);
38
 #define SERIAL_PROTOCOL(x) MSerial.print(x);
31
-#define SERIAL_PROTOCOLPGM(x) serialprintPGM(PSTR(x));
39
+#define SERIAL_PROTOCOLPGM(x) serialprintPGM(MYPGM(x));
32
 #define SERIAL_PROTOCOLLN(x) {MSerial.print(x);MSerial.write('\n');}
40
 #define SERIAL_PROTOCOLLN(x) {MSerial.print(x);MSerial.write('\n');}
33
-#define SERIAL_PROTOCOLLNPGM(x) {serialprintPGM(PSTR(x));MSerial.write('\n');}
41
+#define SERIAL_PROTOCOLLNPGM(x) {serialprintPGM(MYPGM(x));MSerial.write('\n');}
42
+
34
 
43
 
35
-const char errormagic[] PROGMEM ="Error:";
36
-const char echomagic[] PROGMEM ="echo:";
44
+const prog_char errormagic[] PROGMEM ="Error:";
45
+const prog_char echomagic[] PROGMEM ="echo:";
37
 #define SERIAL_ERROR_START serialprintPGM(errormagic);
46
 #define SERIAL_ERROR_START serialprintPGM(errormagic);
38
 #define SERIAL_ERROR(x) SERIAL_PROTOCOL(x)
47
 #define SERIAL_ERROR(x) SERIAL_PROTOCOL(x)
39
 #define SERIAL_ERRORPGM(x) SERIAL_PROTOCOLPGM(x)
48
 #define SERIAL_ERRORPGM(x) SERIAL_PROTOCOLPGM(x)
50
 
59
 
51
 
60
 
52
 //things to write to serial from Programmemory. saves 400 to 2k of RAM.
61
 //things to write to serial from Programmemory. saves 400 to 2k of RAM.
53
-#define SerialprintPGM(x) serialprintPGM(PSTR(x))
62
+#define SerialprintPGM(x) serialprintPGM(MYPGM(x))
54
 FORCE_INLINE void serialprintPGM(const char *str)
63
 FORCE_INLINE void serialprintPGM(const char *str)
55
 {
64
 {
56
   char ch=pgm_read_byte(str);
65
   char ch=pgm_read_byte(str);

+ 5
- 2
Marlin/Marlin.pde View File

167
 
167
 
168
 const int sensitive_pins[] = SENSITIVE_PINS; // Sensitive pin list for M42
168
 const int sensitive_pins[] = SENSITIVE_PINS; // Sensitive pin list for M42
169
 
169
 
170
-static float tt = 0, bt = 0;
170
+//static float tt = 0;
171
+//static float bt = 0;
171
 
172
 
172
 //Inactivity shutdown variables
173
 //Inactivity shutdown variables
173
 static unsigned long previous_millis_cmd = 0;
174
 static unsigned long previous_millis_cmd = 0;
532
       }
533
       }
533
       feedrate = 0.0;
534
       feedrate = 0.0;
534
       home_all_axis = !((code_seen(axis_codes[0])) || (code_seen(axis_codes[1])) || (code_seen(axis_codes[2])));
535
       home_all_axis = !((code_seen(axis_codes[0])) || (code_seen(axis_codes[1])) || (code_seen(axis_codes[2])));
535
-      
536
+      #ifdef QUICK_HOME
536
       if( code_seen(axis_codes[0]) && code_seen(axis_codes[1]) )  //first diagonal move
537
       if( code_seen(axis_codes[0]) && code_seen(axis_codes[1]) )  //first diagonal move
537
       {
538
       {
538
         current_position[X_AXIS] = 0; current_position[Y_AXIS] = 0;
539
         current_position[X_AXIS] = 0; current_position[Y_AXIS] = 0;
545
         prepare_move();
546
         prepare_move();
546
         current_position[X_AXIS] = 0; current_position[Y_AXIS] = 0;
547
         current_position[X_AXIS] = 0; current_position[Y_AXIS] = 0;
547
       }
548
       }
549
+      #endif
548
       
550
       
549
       if((home_all_axis) || (code_seen(axis_codes[X_AXIS]))) 
551
       if((home_all_axis) || (code_seen(axis_codes[X_AXIS]))) 
550
       {
552
       {
669
       SERIAL_ECHO_START;
671
       SERIAL_ECHO_START;
670
       SERIAL_ECHOLN(time);
672
       SERIAL_ECHOLN(time);
671
       LCD_MESSAGE(time);
673
       LCD_MESSAGE(time);
674
+      autotempShutdown();
672
     }
675
     }
673
     break;
676
     break;
674
     case 42: //M42 -Change pin status via gcode
677
     case 42: //M42 -Change pin status via gcode

+ 1
- 0
Marlin/MarlinSerial.cpp View File

20
   Modified 28 September 2010 by Mark Sproul
20
   Modified 28 September 2010 by Mark Sproul
21
 */
21
 */
22
 
22
 
23
+
23
 #include <stdlib.h>
24
 #include <stdlib.h>
24
 #include <stdio.h>
25
 #include <stdio.h>
25
 #include <string.h>
26
 #include <string.h>

+ 1
- 1
Marlin/MarlinSerial.h View File

120
 
120
 
121
     FORCE_INLINE void print(const String &s)
121
     FORCE_INLINE void print(const String &s)
122
     {
122
     {
123
-      for (int i = 0; i < s.length(); i++) {
123
+      for (int i = 0; i < (int)s.length(); i++) {
124
         write(s[i]);
124
         write(s[i]);
125
       }
125
       }
126
     }
126
     }

+ 1
- 1
Marlin/cardreader.h View File

59
   LsAction lsAction; //stored for recursion.
59
   LsAction lsAction; //stored for recursion.
60
   int16_t nrFiles; //counter for the files in the current directory and recycled as position counter for getting the nrFiles'th name in the directory.
60
   int16_t nrFiles; //counter for the files in the current directory and recycled as position counter for getting the nrFiles'th name in the directory.
61
   char* diveDirName;
61
   char* diveDirName;
62
-  void lsDive(char *prepend,SdFile parent);
62
+  void lsDive(const char *prepend,SdFile parent);
63
 };
63
 };
64
   
64
   
65
 
65
 

+ 2
- 1
Marlin/cardreader.pde View File

40
 }
40
 }
41
 
41
 
42
 
42
 
43
-void  CardReader::lsDive(char *prepend,SdFile parent)
43
+void  CardReader::lsDive(const char *prepend,SdFile parent)
44
 {
44
 {
45
   dir_t p;
45
   dir_t p;
46
  uint8_t cnt=0;
46
  uint8_t cnt=0;
436
  {
436
  {
437
    finishAndDisableSteppers();
437
    finishAndDisableSteppers();
438
  }
438
  }
439
+ autotempShutdown();
439
 }
440
 }
440
 #endif //SDSUPPORT
441
 #endif //SDSUPPORT

+ 14
- 11
Marlin/planner.cpp View File

91
 #ifdef AUTOTEMP
91
 #ifdef AUTOTEMP
92
     float autotemp_max=250;
92
     float autotemp_max=250;
93
     float autotemp_min=210;
93
     float autotemp_min=210;
94
-    float autotemp_factor=1;
94
+    float autotemp_factor=0.1;
95
     bool autotemp_enabled=false;
95
     bool autotemp_enabled=false;
96
 #endif
96
 #endif
97
 
97
 
107
 //=============================private variables ============================
107
 //=============================private variables ============================
108
 //===========================================================================
108
 //===========================================================================
109
 
109
 
110
-// Used for the frequency limit
111
-static unsigned char old_direction_bits = 0;               // Old direction bits. Used for speed calculations
112
-static long x_segment_time[3]={0,0,0};                     // Segment times (in us). Used for speed calculations
113
-static long y_segment_time[3]={0,0,0};
110
+#ifdef XY_FREQUENCY_LIMIT
111
+  // Used for the frequency limit
112
+  static unsigned char old_direction_bits = 0;               // Old direction bits. Used for speed calculations
113
+  static long x_segment_time[3]={0,0,0};                     // Segment times (in us). Used for speed calculations
114
+  static long y_segment_time[3]={0,0,0};
115
+#endif
114
 
116
 
115
 // Returns the index of the next block in the ring buffer
117
 // Returns the index of the next block in the ring buffer
116
 // NOTE: Removed modulo (%) operator, which uses an expensive divide and multiplication.
118
 // NOTE: Removed modulo (%) operator, which uses an expensive divide and multiplication.
254
 // planner_recalculate() needs to go over the current plan twice. Once in reverse and once forward. This 
256
 // planner_recalculate() needs to go over the current plan twice. Once in reverse and once forward. This 
255
 // implements the reverse pass.
257
 // implements the reverse pass.
256
 void planner_reverse_pass() {
258
 void planner_reverse_pass() {
257
-  char block_index = block_buffer_head;
259
+  uint8_t block_index = block_buffer_head;
258
   if(((block_buffer_head-block_buffer_tail + BLOCK_BUFFER_SIZE) & (BLOCK_BUFFER_SIZE - 1)) > 3) {
260
   if(((block_buffer_head-block_buffer_tail + BLOCK_BUFFER_SIZE) & (BLOCK_BUFFER_SIZE - 1)) > 3) {
259
     block_index = (block_buffer_head - 3) & (BLOCK_BUFFER_SIZE - 1);
261
     block_index = (block_buffer_head - 3) & (BLOCK_BUFFER_SIZE - 1);
260
     block_t *block[3] = { NULL, NULL, NULL };
262
     block_t *block[3] = { NULL, NULL, NULL };
293
 // planner_recalculate() needs to go over the current plan twice. Once in reverse and once forward. This 
295
 // planner_recalculate() needs to go over the current plan twice. Once in reverse and once forward. This 
294
 // implements the forward pass.
296
 // implements the forward pass.
295
 void planner_forward_pass() {
297
 void planner_forward_pass() {
296
-  char block_index = block_buffer_tail;
298
+  uint8_t block_index = block_buffer_tail;
297
   block_t *block[3] = { NULL, NULL, NULL };
299
   block_t *block[3] = { NULL, NULL, NULL };
298
 
300
 
299
   while(block_index != block_buffer_head) {
301
   while(block_index != block_buffer_head) {
383
     return; //do nothing
385
     return; //do nothing
384
   
386
   
385
   float high=0;
387
   float high=0;
386
-  char block_index = block_buffer_tail;
388
+  uint8_t block_index = block_buffer_tail;
387
   
389
   
388
   while(block_index != block_buffer_head) {
390
   while(block_index != block_buffer_head) {
389
     float se=block_buffer[block_index].steps_e/float(block_buffer[block_index].step_event_count)*block_buffer[block_index].nominal_rate;
391
     float se=block_buffer[block_index].steps_e/float(block_buffer[block_index].step_event_count)*block_buffer[block_index].nominal_rate;
422
   block_t *block;
424
   block_t *block;
423
 
425
 
424
   if(block_buffer_tail != block_buffer_head) {
426
   if(block_buffer_tail != block_buffer_head) {
425
-    char block_index = block_buffer_tail;
427
+    uint8_t block_index = block_buffer_tail;
426
     while(block_index != block_buffer_head) {
428
     while(block_index != block_buffer_head) {
427
       block = &block_buffer[block_index];
429
       block = &block_buffer[block_index];
428
       if(block->steps_x != 0) x_active++;
430
       if(block->steps_x != 0) x_active++;
518
   block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0
520
   block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0
519
   block->nominal_rate = ceil(block->step_event_count * inverse_second); // (step/sec) Always > 0
521
   block->nominal_rate = ceil(block->step_event_count * inverse_second); // (step/sec) Always > 0
520
 
522
 
521
-  //  segment time im micro seconds
522
-  long segment_time = lround(1000000.0/inverse_second);
523
+  
523
  
524
  
524
 
525
 
525
   if (block->steps_e == 0) {
526
   if (block->steps_e == 0) {
537
 #endif
538
 #endif
538
 
539
 
539
 /*
540
 /*
541
+  //  segment time im micro seconds
542
+  long segment_time = lround(1000000.0/inverse_second);
540
   if ((blockcount>0) && (blockcount < (BLOCK_BUFFER_SIZE - 4))) {
543
   if ((blockcount>0) && (blockcount < (BLOCK_BUFFER_SIZE - 4))) {
541
     if (segment_time<minsegmenttime)  { // buffer is draining, add extra time.  The amount of time added increases if the buffer is still emptied more.
544
     if (segment_time<minsegmenttime)  { // buffer is draining, add extra time.  The amount of time added increases if the buffer is still emptied more.
542
         segment_time=segment_time+lround(2*(minsegmenttime-segment_time)/blockcount);
545
         segment_time=segment_time+lround(2*(minsegmenttime-segment_time)/blockcount);

+ 4
- 3
Marlin/stepper.cpp View File

21
 /* The timer calculations of this module informed by the 'RepRap cartesian firmware' by Zack Smith
21
 /* The timer calculations of this module informed by the 'RepRap cartesian firmware' by Zack Smith
22
    and Philipp Tiefenbacher. */
22
    and Philipp Tiefenbacher. */
23
 
23
 
24
+
24
 #include "stepper.h"
25
 #include "stepper.h"
25
 #include "Configuration.h"
26
 #include "Configuration.h"
26
 #include "Marlin.h"
27
 #include "Marlin.h"
454
     // Calculare new timer value
455
     // Calculare new timer value
455
     unsigned short timer;
456
     unsigned short timer;
456
     unsigned short step_rate;
457
     unsigned short step_rate;
457
-    if (step_events_completed <= current_block->accelerate_until) {
458
+    if (step_events_completed <= (unsigned long int)current_block->accelerate_until) {
458
       
459
       
459
       MultiU24X24toH16(acc_step_rate, acceleration_time, current_block->acceleration_rate);
460
       MultiU24X24toH16(acc_step_rate, acceleration_time, current_block->acceleration_rate);
460
       acc_step_rate += current_block->initial_rate;
461
       acc_step_rate += current_block->initial_rate;
478
         
479
         
479
       #endif
480
       #endif
480
     } 
481
     } 
481
-    else if (step_events_completed > current_block->decelerate_after) {   
482
+    else if (step_events_completed > (unsigned long int)current_block->decelerate_after) {   
482
       MultiU24X24toH16(step_rate, deceleration_time, current_block->acceleration_rate);
483
       MultiU24X24toH16(step_rate, deceleration_time, current_block->acceleration_rate);
483
       
484
       
484
       if(step_rate > acc_step_rate) { // Check step_rate stays positive
485
       if(step_rate > acc_step_rate) { // Check step_rate stays positive
695
   CRITICAL_SECTION_END;
696
   CRITICAL_SECTION_END;
696
 }
697
 }
697
 
698
 
698
-long st_get_position(char axis)
699
+long st_get_position(uint8_t axis)
699
 {
700
 {
700
   long count_pos;
701
   long count_pos;
701
   CRITICAL_SECTION_START;
702
   CRITICAL_SECTION_START;

+ 1
- 1
Marlin/stepper.h View File

34
 void st_set_e_position(const long &e);
34
 void st_set_e_position(const long &e);
35
 
35
 
36
 // Get current position in steps
36
 // Get current position in steps
37
-long st_get_position(char axis);
37
+long st_get_position(uint8_t axis);
38
 
38
 
39
 // The stepper subsystem goes to sleep when it runs out of things to execute. Call this
39
 // The stepper subsystem goes to sleep when it runs out of things to execute. Call this
40
 // to notify the subsystem that it is time to go to work.
40
 // to notify the subsystem that it is time to go to work.

+ 14
- 5
Marlin/temperature.cpp View File

67
 //===========================================================================
67
 //===========================================================================
68
 static bool temp_meas_ready = false;
68
 static bool temp_meas_ready = false;
69
 
69
 
70
-static unsigned long previous_millis_heater, previous_millis_bed_heater;
70
+static unsigned long  previous_millis_bed_heater;
71
+//static unsigned long previous_millis_heater;
71
 
72
 
72
 #ifdef PIDTEMP
73
 #ifdef PIDTEMP
73
   //static cannot be external:
74
   //static cannot be external:
80
   static float pid_error;
81
   static float pid_error;
81
   static float temp_iState_min;
82
   static float temp_iState_min;
82
   static float temp_iState_max;
83
   static float temp_iState_max;
83
-  static float pid_input;
84
-  static float pid_output;
84
+ // static float pid_input; 
85
+ // static float pid_output;
85
   static bool pid_reset;
86
   static bool pid_reset;
86
  
87
  
87
 #endif //PIDTEMP
88
 #endif //PIDTEMP
94
 // Init min and max temp with extreme values to prevent false errors during startup
95
 // Init min and max temp with extreme values to prevent false errors during startup
95
   static int minttemp_0   = 0;
96
   static int minttemp_0   = 0;
96
   static int maxttemp_0   = 16383;
97
   static int maxttemp_0   = 16383;
97
-  static int minttemp_1   = 0;
98
-  static int maxttemp_1   = 16383;
98
+  //static int minttemp_1   = 0;
99
+  //static int maxttemp_1   = 16383;
99
   static int bed_minttemp = 0;
100
   static int bed_minttemp = 0;
100
   static int bed_maxttemp = 16383;
101
   static int bed_maxttemp = 16383;
101
 
102
 
268
     return (1023 * OVERSAMPLENR) - raw;
269
     return (1023 * OVERSAMPLENR) - raw;
269
   #elif defined BED_USES_AD595
270
   #elif defined BED_USES_AD595
270
     return lround(celsius * (1024.0 * OVERSAMPLENR/ (5.0 * 100.0) ) );
271
     return lround(celsius * (1024.0 * OVERSAMPLENR/ (5.0 * 100.0) ) );
272
+  #else
273
+    #warning No heater-type defined for the bed.
271
   #endif
274
   #endif
275
+  return 0;
272
 }
276
 }
273
 
277
 
274
 // Derived from RepRap FiveD extruder::getTemperature()
278
 // Derived from RepRap FiveD extruder::getTemperature()
296
     return celsius;
300
     return celsius;
297
   #elif defined HEATER_0_USES_AD595
301
   #elif defined HEATER_0_USES_AD595
298
     return raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR;
302
     return raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR;
303
+  #else
304
+    #error PLEASE DEFINE HEATER TYPE 
299
   #endif
305
   #endif
300
 }
306
 }
301
 
307
 
328
     
334
     
329
   #elif defined BED_USES_AD595
335
   #elif defined BED_USES_AD595
330
     return raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR;
336
     return raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR;
337
+  #else
338
+    #warning No heater-type defined for the bed.
331
   #endif
339
   #endif
340
+  return 0;
332
 }
341
 }
333
 
342
 
334
 void tp_init()
343
 void tp_init()

+ 15
- 3
Marlin/temperature.h View File

86
   #endif //PIDTEMP
86
   #endif //PIDTEMP
87
 };
87
 };
88
 FORCE_INLINE void setTargetHotend1(const float &celsius) {  target_raw[TEMPSENSOR_HOTEND_1]=temp2analog(celsius);};
88
 FORCE_INLINE void setTargetHotend1(const float &celsius) {  target_raw[TEMPSENSOR_HOTEND_1]=temp2analog(celsius);};
89
-FORCE_INLINE float setTargetHotend(const float &celcius, uint8_t extruder){  
89
+FORCE_INLINE void setTargetHotend(const float &celcius, uint8_t extruder){  
90
   if(extruder == 0) setTargetHotend0(celcius);
90
   if(extruder == 0) setTargetHotend0(celcius);
91
   if(extruder == 1) setTargetHotend1(celcius);
91
   if(extruder == 1) setTargetHotend1(celcius);
92
 };
92
 };
94
 
94
 
95
 FORCE_INLINE bool isHeatingHotend0() {return heatingtarget_raw[TEMPSENSOR_HOTEND_0] > current_raw[TEMPSENSOR_HOTEND_0];};
95
 FORCE_INLINE bool isHeatingHotend0() {return heatingtarget_raw[TEMPSENSOR_HOTEND_0] > current_raw[TEMPSENSOR_HOTEND_0];};
96
 FORCE_INLINE bool isHeatingHotend1() {return target_raw[TEMPSENSOR_HOTEND_1] > current_raw[TEMPSENSOR_HOTEND_1];};
96
 FORCE_INLINE bool isHeatingHotend1() {return target_raw[TEMPSENSOR_HOTEND_1] > current_raw[TEMPSENSOR_HOTEND_1];};
97
-FORCE_INLINE float isHeatingHotend(uint8_t extruder){  
97
+FORCE_INLINE bool isHeatingHotend(uint8_t extruder){  
98
   if(extruder == 0) return heatingtarget_raw[TEMPSENSOR_HOTEND_0] > current_raw[TEMPSENSOR_HOTEND_0];
98
   if(extruder == 0) return heatingtarget_raw[TEMPSENSOR_HOTEND_0] > current_raw[TEMPSENSOR_HOTEND_0];
99
   if(extruder == 1) return target_raw[TEMPSENSOR_HOTEND_1] > current_raw[TEMPSENSOR_HOTEND_1];
99
   if(extruder == 1) return target_raw[TEMPSENSOR_HOTEND_1] > current_raw[TEMPSENSOR_HOTEND_1];
100
+  return false; 
100
 };
101
 };
101
 FORCE_INLINE bool isHeatingBed() {return target_raw[TEMPSENSOR_BED] > current_raw[TEMPSENSOR_BED];};
102
 FORCE_INLINE bool isHeatingBed() {return target_raw[TEMPSENSOR_BED] > current_raw[TEMPSENSOR_BED];};
102
 
103
 
103
 FORCE_INLINE bool isCoolingHotend0() {return target_raw[TEMPSENSOR_HOTEND_0] < current_raw[TEMPSENSOR_HOTEND_0];};
104
 FORCE_INLINE bool isCoolingHotend0() {return target_raw[TEMPSENSOR_HOTEND_0] < current_raw[TEMPSENSOR_HOTEND_0];};
104
 FORCE_INLINE bool isCoolingHotend1() {return target_raw[TEMPSENSOR_HOTEND_1] < current_raw[TEMPSENSOR_HOTEND_1];};
105
 FORCE_INLINE bool isCoolingHotend1() {return target_raw[TEMPSENSOR_HOTEND_1] < current_raw[TEMPSENSOR_HOTEND_1];};
105
-FORCE_INLINE float isCoolingHotend(uint8_t extruder){  
106
+FORCE_INLINE bool isCoolingHotend(uint8_t extruder){  
106
   if(extruder == 0) return target_raw[TEMPSENSOR_HOTEND_0] < current_raw[TEMPSENSOR_HOTEND_0];
107
   if(extruder == 0) return target_raw[TEMPSENSOR_HOTEND_0] < current_raw[TEMPSENSOR_HOTEND_0];
107
   if(extruder == 1) return target_raw[TEMPSENSOR_HOTEND_1] < current_raw[TEMPSENSOR_HOTEND_1];
108
   if(extruder == 1) return target_raw[TEMPSENSOR_HOTEND_1] < current_raw[TEMPSENSOR_HOTEND_1];
109
+  return false; 
108
 };
110
 };
109
 FORCE_INLINE bool isCoolingBed() {return target_raw[TEMPSENSOR_BED] < current_raw[TEMPSENSOR_BED];};
111
 FORCE_INLINE bool isCoolingBed() {return target_raw[TEMPSENSOR_BED] < current_raw[TEMPSENSOR_BED];};
110
 
112
 
113
+FORCE_INLINE void autotempShutdown(){
114
+ #ifdef AUTOTEMP
115
+ if(autotemp_enabled)
116
+ {
117
+  autotemp_enabled=false;
118
+  if(degTargetHotend0()>autotemp_min)
119
+    setTargetHotend0(0);
120
+ }
121
+ #endif
122
+}
111
 void disable_heater();
123
 void disable_heater();
112
 void setWatch();
124
 void setWatch();
113
 void updatePID();
125
 void updatePID();

+ 2
- 3
Marlin/ultralcd.h View File

1
 #ifndef __ULTRALCDH
1
 #ifndef __ULTRALCDH
2
 #define __ULTRALCDH
2
 #define __ULTRALCDH
3
 #include "Configuration.h"
3
 #include "Configuration.h"
4
-
4
+#include "Marlin.h"
5
 #ifdef ULTRA_LCD
5
 #ifdef ULTRA_LCD
6
 
6
 
7
   void lcd_status();
7
   void lcd_status();
104
             curencoderpos=maxlines*lcdslow; 
104
             curencoderpos=maxlines*lcdslow; 
105
         } 
105
         } 
106
         lastencoderpos=encoderpos=curencoderpos;
106
         lastencoderpos=encoderpos=curencoderpos;
107
-        int lastactiveline=activeline;
108
         activeline=curencoderpos/lcdslow;
107
         activeline=curencoderpos/lcdslow;
109
         if(activeline<0) activeline=0;
108
         if(activeline<0) activeline=0;
110
         if(activeline>LCD_HEIGHT-1) activeline=LCD_HEIGHT-1;
109
         if(activeline>LCD_HEIGHT-1) activeline=LCD_HEIGHT-1;
137
 
136
 
138
 
137
 
139
   #define LCD_MESSAGE(x) lcd_status(x);
138
   #define LCD_MESSAGE(x) lcd_status(x);
140
-  #define LCD_MESSAGEPGM(x) lcd_statuspgm(PSTR(x));
139
+  #define LCD_MESSAGEPGM(x) lcd_statuspgm(MYPGM(x));
141
   #define LCD_STATUS lcd_status()
140
   #define LCD_STATUS lcd_status()
142
 #else //no lcd
141
 #else //no lcd
143
   #define LCD_STATUS
142
   #define LCD_STATUS

+ 439
- 412
Marlin/ultralcd.pde
File diff suppressed because it is too large
View File


Loading…
Cancel
Save