浏览代码

project progmem finished: total change with ultipanel: 2456 byte free ram initial. now: 4374 ram.

Bernhard Kubicek 13 年前
父节点
当前提交
ab154d5592
共有 10 个文件被更改,包括 293 次插入186 次删除
  1. 106
    106
      Marlin/EEPROMwrite.h
  2. 42
    7
      Marlin/Marlin.h
  3. 79
    45
      Marlin/Marlin.pde
  4. 2
    2
      Marlin/cardreader.h
  5. 26
    12
      Marlin/cardreader.pde
  6. 3
    1
      Marlin/stepper.cpp
  7. 15
    8
      Marlin/temperature.cpp
  8. 1
    0
      Marlin/ultralcd.h
  9. 15
    2
      Marlin/ultralcd.pde
  10. 4
    3
      Marlin/watchdog.pde

+ 106
- 106
Marlin/EEPROMwrite.h 查看文件

@@ -25,18 +25,9 @@ template <class T> int EEPROM_readAnything(int &ee, T& value)
25 25
 }
26 26
 //======================================================================================
27 27
 
28
-#include <avr/pgmspace.h>
28
+#define SERIAL_ECHOPAIR(name,value) {SERIAL_ECHOPGM(name);SERIAL_ECHO(value);}
29
+
29 30
 
30
-void serialprintPGM(const char *str)
31
-{
32
-  char ch=pgm_read_byte(str);
33
-  while(ch)
34
-  {
35
-    Serial.print(ch);
36
-    ch=pgm_read_byte(++str);
37
-  }
38
-}
39
-#define SerialprintPGM(x) serialprintPGM(PSTR(x))
40 31
 
41 32
 #define EEPROM_OFFSET 100
42 33
 
@@ -48,8 +39,9 @@ void serialprintPGM(const char *str)
48 39
 // ALSO:  always make sure the variables in the Store and retrieve sections are in the same order.
49 40
 #define EEPROM_VERSION "V04"  
50 41
 
51
-void StoreSettings() 
42
+inline void StoreSettings() 
52 43
 {
44
+#ifdef EEPROM_SETTINGS
53 45
   char ver[4]= "000";
54 46
   int i=EEPROM_OFFSET;
55 47
   EEPROM_writeAnything(i,ver); // invalidate data first 
@@ -75,107 +67,115 @@ void StoreSettings()
75 67
   char ver2[4]=EEPROM_VERSION;
76 68
   i=EEPROM_OFFSET;
77 69
   EEPROM_writeAnything(i,ver2); // validate data
78
-  SerialprintPGM("echo: Settings Stored\n");
70
+  SERIAL_ECHO_START;
71
+  SERIAL_ECHOLNPGM("Settings Stored");
72
+#endif //EEPROM_SETTINGS
79 73
 }
80 74
 
81
-void RetrieveSettings(bool def=false)
75
+inline void RetrieveSettings(bool def=false)
82 76
 {  // if def=true, the default values will be used
83
-  int i=EEPROM_OFFSET;
84
-  char stored_ver[4];
85
-  char ver[4]=EEPROM_VERSION;
86
-  EEPROM_readAnything(i,stored_ver); //read stored version
87
-  //  SERIAL_ECHOLN("Version: [" << ver << "] Stored version: [" << stored_ver << "]");
88
-  if ((!def)&&(strncmp(ver,stored_ver,3)==0)) 
89
-  {   // version number match
90
-    EEPROM_readAnything(i,axis_steps_per_unit);  
91
-    EEPROM_readAnything(i,max_feedrate);  
92
-    EEPROM_readAnything(i,max_acceleration_units_per_sq_second);
93
-    EEPROM_readAnything(i,acceleration);
94
-    EEPROM_readAnything(i,retract_acceleration);
95
-    EEPROM_readAnything(i,minimumfeedrate);
96
-    EEPROM_readAnything(i,mintravelfeedrate);
97
-    EEPROM_readAnything(i,minsegmenttime);
98
-    EEPROM_readAnything(i,max_xy_jerk);
99
-    EEPROM_readAnything(i,max_z_jerk);
100
-    #ifndef PIDTEMP
101
-      float Kp,Ki,Kd;
102
-    #endif
103
-    EEPROM_readAnything(i,Kp);
104
-    EEPROM_readAnything(i,Ki);
105
-    EEPROM_readAnything(i,Kd);
77
+  #ifdef EEPROM_SETTINGS
78
+    int i=EEPROM_OFFSET;
79
+    char stored_ver[4];
80
+    char ver[4]=EEPROM_VERSION;
81
+    EEPROM_readAnything(i,stored_ver); //read stored version
82
+    //  SERIAL_ECHOLN("Version: [" << ver << "] Stored version: [" << stored_ver << "]");
83
+    if ((!def)&&(strncmp(ver,stored_ver,3)==0)) 
84
+    {   // version number match
85
+      EEPROM_readAnything(i,axis_steps_per_unit);  
86
+      EEPROM_readAnything(i,max_feedrate);  
87
+      EEPROM_readAnything(i,max_acceleration_units_per_sq_second);
88
+      EEPROM_readAnything(i,acceleration);
89
+      EEPROM_readAnything(i,retract_acceleration);
90
+      EEPROM_readAnything(i,minimumfeedrate);
91
+      EEPROM_readAnything(i,mintravelfeedrate);
92
+      EEPROM_readAnything(i,minsegmenttime);
93
+      EEPROM_readAnything(i,max_xy_jerk);
94
+      EEPROM_readAnything(i,max_z_jerk);
95
+      #ifndef PIDTEMP
96
+        float Kp,Ki,Kd;
97
+      #endif
98
+      EEPROM_readAnything(i,Kp);
99
+      EEPROM_readAnything(i,Ki);
100
+      EEPROM_readAnything(i,Kd);
106 101
 
107
-    SerialprintPGM("echo: Stored settings retreived:\n");
108
-  }
109
-  else 
110
-  {
111
-    float tmp1[]=DEFAULT_AXIS_STEPS_PER_UNIT;
112
-    float tmp2[]=DEFAULT_MAX_FEEDRATE;
113
-    long tmp3[]=DEFAULT_MAX_ACCELERATION;
114
-    for (short i=0;i<4;i++) 
102
+      SERIAL_ECHO_START;
103
+      SERIAL_ECHOLNPGM("Stored settings retreived:");
104
+    }
105
+    else 
115 106
     {
116
-      axis_steps_per_unit[i]=tmp1[i];  
117
-      max_feedrate[i]=tmp2[i];  
118
-      max_acceleration_units_per_sq_second[i]=tmp3[i];
107
+      float tmp1[]=DEFAULT_AXIS_STEPS_PER_UNIT;
108
+      float tmp2[]=DEFAULT_MAX_FEEDRATE;
109
+      long tmp3[]=DEFAULT_MAX_ACCELERATION;
110
+      for (short i=0;i<4;i++) 
111
+      {
112
+        axis_steps_per_unit[i]=tmp1[i];  
113
+        max_feedrate[i]=tmp2[i];  
114
+        max_acceleration_units_per_sq_second[i]=tmp3[i];
115
+      }
116
+      acceleration=DEFAULT_ACCELERATION;
117
+      retract_acceleration=DEFAULT_RETRACT_ACCELERATION;
118
+      minimumfeedrate=DEFAULT_MINIMUMFEEDRATE;
119
+      minsegmenttime=DEFAULT_MINSEGMENTTIME;       
120
+      mintravelfeedrate=DEFAULT_MINTRAVELFEEDRATE;
121
+      max_xy_jerk=DEFAULT_XYJERK;
122
+      max_z_jerk=DEFAULT_ZJERK;
123
+      SERIAL_ECHO_START;
124
+      SERIAL_ECHOLN("Using Default settings:");
119 125
     }
120
-    acceleration=DEFAULT_ACCELERATION;
121
-    retract_acceleration=DEFAULT_RETRACT_ACCELERATION;
122
-    minimumfeedrate=DEFAULT_MINIMUMFEEDRATE;
123
-    minsegmenttime=DEFAULT_MINSEGMENTTIME;       
124
-    mintravelfeedrate=DEFAULT_MINTRAVELFEEDRATE;
125
-    max_xy_jerk=DEFAULT_XYJERK;
126
-    max_z_jerk=DEFAULT_ZJERK;
127
-    SerialprintPGM("echo: Using Default settings:\n");
128
-  }
129
-  SerialprintPGM("echo: Steps per unit:\n   M92 X");
130
-    Serial.print(axis_steps_per_unit[0]);
131
-    SerialprintPGM(" Y"); 
132
-    Serial.print(axis_steps_per_unit[1]);
133
-    SerialprintPGM(" Z");
134
-    Serial.print(axis_steps_per_unit[2]);
135
-    SerialprintPGM(" E");
136
-    Serial.print(axis_steps_per_unit[3]);
137
-    
138
-  SerialprintPGM("\nMaximum feedrates (mm/s):\n   M203 X"  );
139
-    Serial.print(max_feedrate[0]/60);
140
-    SerialprintPGM(" Y" ); 
141
-    Serial.print(max_feedrate[1]/60 ); 
142
-    SerialprintPGM(" Z" ); 
143
-    Serial.print(max_feedrate[2]/60 ); 
144
-    SerialprintPGM(" E" ); 
145
-    Serial.print(max_feedrate[3]/60);
146
-  SerialprintPGM("\nMaximum Acceleration (mm/s2):\n   M201 X"  );
147
-    Serial.print(max_acceleration_units_per_sq_second[0] ); 
148
-    SerialprintPGM(" Y" ); 
149
-    Serial.print(max_acceleration_units_per_sq_second[1] ); 
150
-    SerialprintPGM(" Z" ); 
151
-    Serial.print(max_acceleration_units_per_sq_second[2] );
152
-    SerialprintPGM(" E" ); 
153
-    Serial.print(max_acceleration_units_per_sq_second[3]);
154
-  SerialprintPGM("\necho: Acceleration: S=acceleration, T=retract acceleration\n   M204 S"  );
155
-    Serial.print(acceleration ); 
156
-    SerialprintPGM(" T" ); 
157
-    Serial.print(retract_acceleration);
158
-  SerialprintPGM("\necho: Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum xY jerk (mm/s),  Z=maximum Z jerk (mm/s)");
159
-  SerialprintPGM("   M205 S"  );
160
-    Serial.print(minimumfeedrate/60 ); 
161
-    SerialprintPGM(" T" ); 
162
-    Serial.print(mintravelfeedrate/60 ); 
163
-    SerialprintPGM(" B" ); 
164
-    Serial.print(minsegmenttime ); 
165
-    SerialprintPGM(" X" ); 
166
-    Serial.print(max_xy_jerk/60 ); 
167
-    SerialprintPGM(" Z" ); 
168
-    Serial.print(max_z_jerk/60);
169
-    SerialprintPGM("\n" ); 
170
-  #ifdef PIDTEMP
171
-    SerialprintPGM("PID settings:");
172
-    SerialprintPGM("   M301 P"  ); 
173
-    Serial.print(Kp ); 
174
-    SerialprintPGM(" I" ); 
175
-    Serial.print(Ki ); 
176
-    SerialprintPGM(" D" ); 
177
-    Serial.print(Kd);  
126
+  #ifdef EEPROM_CHITCHAT
127
+    SERIAL_ECHO_START;
128
+      SERIAL_ECHOLNPGM("Steps per unit:");
129
+      SERIAL_ECHO_START;
130
+      SERIAL_ECHOPAIR("  M92 X",axis_steps_per_unit[0]);
131
+      SERIAL_ECHOPAIR(" Y",axis_steps_per_unit[1]);
132
+      SERIAL_ECHOPAIR(" Z",axis_steps_per_unit[2]);
133
+      SERIAL_ECHOPAIR(" E",axis_steps_per_unit[3]);
134
+      SERIAL_ECHOLN("");
135
+      
136
+    SERIAL_ECHO_START;
137
+      SERIAL_ECHOLNPGM("Maximum feedrates (mm/s):");
138
+      SERIAL_ECHO_START;
139
+      SERIAL_ECHOPAIR("  M203 X",max_feedrate[0]/60);
140
+      SERIAL_ECHOPAIR(" Y",max_feedrate[1]/60 ); 
141
+      SERIAL_ECHOPAIR(" Z", max_feedrate[2]/60 ); 
142
+      SERIAL_ECHOPAIR(" E", max_feedrate[3]/60);
143
+      SERIAL_ECHOLN("");
144
+    SERIAL_ECHO_START;
145
+      SERIAL_ECHOLNPGM("Maximum Acceleration (mm/s2):");
146
+      SERIAL_ECHO_START;
147
+      SERIAL_ECHOPAIR("  M201 X" ,max_acceleration_units_per_sq_second[0] ); 
148
+      SERIAL_ECHOPAIR(" Y" , max_acceleration_units_per_sq_second[1] ); 
149
+      SERIAL_ECHOPAIR(" Z" ,max_acceleration_units_per_sq_second[2] );
150
+      SERIAL_ECHOPAIR(" E" ,max_acceleration_units_per_sq_second[3]);
151
+      SERIAL_ECHOLN("");
152
+    SERIAL_ECHO_START;
153
+      SERIAL_ECHOLNPGM("Acceleration: S=acceleration, T=retract acceleration");
154
+      SERIAL_ECHO_START;
155
+      SERIAL_ECHOPAIR("  M204 S",acceleration ); 
156
+      SERIAL_ECHOPAIR(" T" ,retract_acceleration);
157
+      SERIAL_ECHOLN("");
158
+    SERIAL_ECHO_START;
159
+      SERIAL_ECHOLNPGM("Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum xY jerk (mm/s),  Z=maximum Z jerk (mm/s)");
160
+      SERIAL_ECHO_START;
161
+      SERIAL_ECHOPAIR("  M205 S",minimumfeedrate/60 ); 
162
+      SERIAL_ECHOPAIR(" T" ,mintravelfeedrate/60 ); 
163
+      SERIAL_ECHOPAIR(" B" ,minsegmenttime ); 
164
+      SERIAL_ECHOPAIR(" X" ,max_xy_jerk/60 ); 
165
+      SERIAL_ECHOPAIR(" Z" ,max_z_jerk/60);
166
+      SERIAL_ECHOLN(""); 
167
+    #ifdef PIDTEMP
168
+      SERIAL_ECHO_START;
169
+      SERIAL_ECHOLNPGM("PID settings:");
170
+      SERIAL_ECHO_START;
171
+      SERIAL_ECHOPAIR("   M301 P",Kp ); 
172
+      SERIAL_ECHOPAIR(" I" ,Ki ); 
173
+      SERIAL_ECHOPAIR(" D" ,Kd);
174
+      SERIAL_ECHOLN(""); 
175
+    #endif
178 176
   #endif
177
+    
178
+  #endif //EEPROM_SETTINGS
179 179
 }  
180 180
 
181 181
 #endif

+ 42
- 7
Marlin/Marlin.h 查看文件

@@ -5,14 +5,49 @@
5 5
 // Licence: GPL
6 6
 #include <WProgram.h>
7 7
 #include "fastio.h"
8
-
9 8
 #include "streaming.h"
10
-#define SERIAL_ECHO(x) Serial << "echo: " << x;
11
-#define SERIAL_ECHOLN(x) Serial << "echo: "<<x<<endl;
12
-#define SERIAL_ERROR(x) Serial << "Error: " << x;
13
-#define SERIAL_ERRORLN(x) Serial << "Error: " << x<<endl;
14
-#define SERIAL_PROTOCOL(x) Serial << x;
15
-#define SERIAL_PROTOCOLLN(x) Serial << x<<endl;
9
+#include <avr/pgmspace.h>
10
+
11
+//#define SERIAL_ECHO(x) Serial << "echo: " << x;
12
+//#define SERIAL_ECHOLN(x) Serial << "echo: "<<x<<endl;
13
+//#define SERIAL_ERROR(x) Serial << "Error: " << x;
14
+//#define SERIAL_ERRORLN(x) Serial << "Error: " << x<<endl;
15
+//#define SERIAL_PROTOCOL(x) Serial << x;
16
+//#define SERIAL_PROTOCOLLN(x) Serial << x<<endl;
17
+
18
+
19
+
20
+#define SERIAL_PROTOCOL(x) Serial.print(x);
21
+#define SERIAL_PROTOCOLPGM(x) serialprintPGM(PSTR(x));
22
+#define SERIAL_PROTOCOLLN(x) {Serial.print(x);Serial.write('\n');}
23
+#define SERIAL_PROTOCOLLNPGM(x) {serialprintPGM(PSTR(x));Serial.write('\n');}
24
+
25
+const char errormagic[] PROGMEM ="Error:";
26
+const char echomagic[] PROGMEM ="echo:";
27
+#define SERIAL_ERROR_START serialprintPGM(errormagic);
28
+#define SERIAL_ERROR(x) SERIAL_PROTOCOL(x)
29
+#define SERIAL_ERRORPGM(x) SERIAL_PROTOCOLPGM(x)
30
+#define SERIAL_ERRORLN(x) SERIAL_PROTOCOLLN(x)
31
+#define SERIAL_ERRORLNPGM(x) SERIAL_PROTOCOLLNPGM(x)
32
+
33
+#define SERIAL_ECHO_START serialprintPGM(echomagic);
34
+#define SERIAL_ECHO(x) SERIAL_PROTOCOL(x)
35
+#define SERIAL_ECHOPGM(x) SERIAL_PROTOCOLPGM(x)
36
+#define SERIAL_ECHOLN(x) SERIAL_PROTOCOLLN(x)
37
+#define SERIAL_ECHOLNPGM(x) SERIAL_PROTOCOLLNPGM(x)
38
+
39
+//things to write to serial from Programmemory. saves 400 to 2k of RAM.
40
+#define SerialprintPGM(x) serialprintPGM(PSTR(x))
41
+inline void serialprintPGM(const char *str)
42
+{
43
+  char ch=pgm_read_byte(str);
44
+  while(ch)
45
+  {
46
+    Serial.write(ch);
47
+    ch=pgm_read_byte(++str);
48
+  }
49
+}
50
+
16 51
 
17 52
 void get_command();
18 53
 void process_commands();

+ 79
- 45
Marlin/Marlin.pde 查看文件

@@ -101,7 +101,7 @@ char version_string[] = "1.0.0 Alpha 1";
101 101
 // M220 - set speed factor override percentage S:factor in percent
102 102
 // M301 - Set PID parameters P I and D
103 103
 // M500 - stores paramters in EEPROM
104
-// M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).  D
104
+// M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).  
105 105
 // M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
106 106
 
107 107
 //Stepper Movement Variables
@@ -199,7 +199,10 @@ void enquecommand(const char *cmd)
199 199
   {
200 200
     //this is dangerous if a mixing of serial and this happsens
201 201
     strcpy(&(cmdbuffer[bufindw][0]),cmd);
202
-    SERIAL_ECHOLN("enqueing \""<<cmdbuffer[bufindw]<<"\"");
202
+    SERIAL_ECHO_START;
203
+    SERIAL_ECHOPGM("enqueing \"");
204
+    SERIAL_ECHO(cmdbuffer[bufindw]);
205
+    SERIAL_ECHOLNPGM("\"");
203 206
     bufindw= (bufindw + 1)%BUFSIZE;
204 207
     buflen += 1;
205 208
   }
@@ -208,10 +211,13 @@ void enquecommand(const char *cmd)
208 211
 void setup()
209 212
 { 
210 213
   Serial.begin(BAUDRATE);
211
-  SERIAL_ECHOLN("Marlin "<<version_string);
212
-  SERIAL_PROTOCOLLN("start");
213
-  Serial.print("echo: Free Memory:");
214
-  serial.println(freeMemory());
214
+  SERIAL_ECHO_START;
215
+  SERIAL_ECHOPGM("Marlin ");
216
+  SERIAL_ECHOLN(version_string);
217
+  SERIAL_PROTOCOLLNPGM("start");
218
+  SERIAL_ECHO_START;
219
+  SERIAL_ECHOPGM("Free Memory:");
220
+  SERIAL_ECHOLN(freeMemory());
215 221
   for(int8_t i = 0; i < BUFSIZE; i++)
216 222
   {
217 223
     fromsd[i] = false;
@@ -244,12 +250,12 @@ void loop()
244 250
 	if(strstr(cmdbuffer[bufindr],"M29") == NULL)
245 251
 	{
246 252
 	  card.write_command(cmdbuffer[bufindr]);
247
-	  SERIAL_PROTOCOLLN("ok");
253
+	  SERIAL_PROTOCOLLNPGM("ok");
248 254
 	}
249 255
 	else
250 256
 	{
251 257
 	  card.closefile();
252
-	  SERIAL_PROTOCOLLN("Done saving file.");
258
+	  SERIAL_PROTOCOLLNPGM("Done saving file.");
253 259
 	}
254 260
       }
255 261
       else
@@ -284,7 +290,9 @@ inline void get_command()
284 290
           strchr_pointer = strchr(cmdbuffer[bufindw], 'N');
285 291
           gcode_N = (strtol(&cmdbuffer[bufindw][strchr_pointer - cmdbuffer[bufindw] + 1], NULL, 10));
286 292
           if(gcode_N != gcode_LastN+1 && (strstr(cmdbuffer[bufindw], "M110") == NULL) ) {
287
-            SERIAL_ERRORLN("Line Number is not Last Line Number+1, Last Line:"<<gcode_LastN);
293
+            SERIAL_ERROR_START;
294
+            SERIAL_ERRORPGM("Line Number is not Last Line Number+1, Last Line:");
295
+            SERIAL_ERRORLN(gcode_LastN);
288 296
             //Serial.println(gcode_N);
289 297
             FlushSerialRequestResend();
290 298
             serial_count = 0;
@@ -299,7 +307,9 @@ inline void get_command()
299 307
             strchr_pointer = strchr(cmdbuffer[bufindw], '*');
300 308
 
301 309
             if( (int)(strtod(&cmdbuffer[bufindw][strchr_pointer - cmdbuffer[bufindw] + 1], NULL)) != checksum) {
302
-              SERIAL_ERRORLN("checksum mismatch, Last Line:"<<gcode_LastN);
310
+              SERIAL_ERROR_START;
311
+              SERIAL_ERRORPGM("checksum mismatch, Last Line:");
312
+              SERIAL_ERRORLN(gcode_LastN);
303 313
               FlushSerialRequestResend();
304 314
               serial_count = 0;
305 315
               return;
@@ -308,7 +318,9 @@ inline void get_command()
308 318
           }
309 319
           else 
310 320
           {
311
-            SERIAL_ERRORLN("No Checksum with line number, Last Line:"<<gcode_LastN);
321
+            SERIAL_ERROR_START;
322
+            SERIAL_ERRORPGM("No Checksum with line number, Last Line:");
323
+            SERIAL_ERRORLN(gcode_LastN);
312 324
             FlushSerialRequestResend();
313 325
             serial_count = 0;
314 326
             return;
@@ -321,7 +333,9 @@ inline void get_command()
321 333
         {
322 334
           if((strstr(cmdbuffer[bufindw], "*") != NULL))
323 335
           {
324
-            SERIAL_ERRORLN("No Line Number with checksum, Last Line:"<<gcode_LastN);
336
+            SERIAL_ERROR_START;
337
+            SERIAL_ERRORPGM("No Line Number with checksum, Last Line:");
338
+            SERIAL_ERRORLN(gcode_LastN);
325 339
             serial_count = 0;
326 340
             return;
327 341
           }
@@ -337,7 +351,7 @@ inline void get_command()
337 351
             if(card.saving)
338 352
               break;
339 353
 	    #endif //SDSUPPORT
340
-            SERIAL_PROTOCOLLN("ok"); 
354
+            SERIAL_PROTOCOLLNPGM("ok"); 
341 355
             break;
342 356
           default:
343 357
             break;
@@ -362,14 +376,14 @@ inline void get_command()
362 376
     return;
363 377
   }
364 378
   while( !card.eof()  && buflen < BUFSIZE) {
365
-    
366
-    serial_char = card.get();
367
-    if(serial_char == '\n' || serial_char == '\r' || serial_char == ':' || serial_count >= (MAX_CMD_SIZE - 1)) 
379
+    int16_t n=card.get();
380
+    serial_char = (char)n;
381
+    if(serial_char == '\n' || serial_char == '\r' || serial_char == ':' || serial_count >= (MAX_CMD_SIZE - 1)||n==-1) 
368 382
     {
369 383
      
370 384
       if(card.eof()){
371 385
         card.sdprinting = false;
372
-        SERIAL_PROTOCOL("Done printing file");
386
+        SERIAL_PROTOCOLLNPGM("Done printing file");
373 387
         stoptime=millis();
374 388
         char time[30];
375 389
         unsigned long t=(stoptime-starttime)/1000;
@@ -377,6 +391,7 @@ inline void get_command()
377 391
         min=t/60;
378 392
         sec=t%60;
379 393
         sprintf(time,"%i min, %i sec",min,sec);
394
+        SERIAL_ECHO_START;
380 395
         SERIAL_ECHOLN(time);
381 396
         LCD_MESSAGE(time);
382 397
         card.checkautostart(true);
@@ -398,6 +413,7 @@ inline void get_command()
398 413
       if(!comment_mode) cmdbuffer[bufindw][serial_count++] = serial_char;
399 414
     }
400 415
   }
416
+  
401 417
   #endif //SDSUPPORT
402 418
 
403 419
 }
@@ -473,6 +489,7 @@ inline void process_commands()
473 489
       previous_millis_cmd = millis();
474 490
       return;
475 491
     case 4: // G4 dwell
492
+      LCD_MESSAGEPGM("DWELL...");
476 493
       codenum = 0;
477 494
       if(code_seen('P')) codenum = code_value(); // milliseconds to wait
478 495
       if(code_seen('S')) codenum = code_value() * 1000; // seconds to wait
@@ -533,13 +550,14 @@ inline void process_commands()
533 550
     #ifdef SDSUPPORT
534 551
 
535 552
     case 20: // M20 - list SD card
536
-      SERIAL_PROTOCOLLN("Begin file list");
553
+      SERIAL_PROTOCOLLNPGM("Begin file list");
537 554
       card.ls();
538
-      SERIAL_PROTOCOLLN("End file list");
555
+      SERIAL_PROTOCOLLNPGM("End file list");
539 556
       break;
540 557
     case 21: // M21 - init SD card
541 558
       
542 559
       card.initsd();
560
+      
543 561
       break;
544 562
     case 22: //M22 - release SD card
545 563
       card.release();
@@ -592,7 +610,8 @@ inline void process_commands()
592 610
       min=t/60;
593 611
       sec=t%60;
594 612
       sprintf(time,"%i min, %i sec",min,sec);
595
-      SERIAL_ERRORLN(time);
613
+      SERIAL_ECHO_START;
614
+      SERIAL_ECHOLN(time);
596 615
       LCD_MESSAGE(time);
597 616
     }
598 617
     break;
@@ -637,7 +656,7 @@ inline void process_commands()
637 656
           bt = degBed();
638 657
       #endif
639 658
       #if (TEMP_0_PIN > -1) || defined (HEATER_USES_AD595)
640
-        SERIAL_PROTOCOL("ok T:");
659
+        SERIAL_PROTOCOLPGM("ok T:");
641 660
         SERIAL_PROTOCOL(tt); 
642 661
         #if TEMP_1_PIN > -1 
643 662
           #ifdef PIDTEMP
@@ -654,13 +673,14 @@ inline void process_commands()
654 673
             SERIAL_PROTOCOLLN("");
655 674
           #endif //TEMP_1_PIN
656 675
         #else
657
-          SERIAL_ERRORLN("No thermistors - no temp");
676
+          SERIAL_ERROR_START;
677
+          SERIAL_ERRORLNPGM("No thermistors - no temp");
658 678
       #endif
659 679
       return;
660 680
       break;
661 681
     case 109: 
662 682
     {// M109 - Wait for extruder heater to reach target.
663
-        LCD_MESSAGE("Heating...");
683
+        LCD_MESSAGEPGM("Heating...");
664 684
         if (code_seen('S')) setTargetHotend0(code_value());
665 685
         
666 686
         setWatch();
@@ -681,7 +701,8 @@ inline void process_commands()
681 701
         #endif //TEMP_RESIDENCY_TIME
682 702
         if( (millis() - codenum) > 1000 ) 
683 703
         { //Print Temp Reading every 1 second while heating up/cooling down
684
-          SERIAL_PROTOCOLLN("T:"<< degHotend0() ); 
704
+          SERIAL_PROTOCOLPGM("T:");
705
+          SERIAL_PROTOCOLLN( degHotend0() ); 
685 706
           codenum = millis();
686 707
         }
687 708
         manage_heater();
@@ -697,12 +718,13 @@ inline void process_commands()
697 718
           }
698 719
         #endif //TEMP_RESIDENCY_TIME
699 720
         }
700
-        LCD_MESSAGE("Heating done.");
721
+        LCD_MESSAGEPGM("Heating done.");
701 722
         starttime=millis();
702 723
       }
703 724
       break;
704 725
     case 190: // M190 - Wait bed for heater to reach target.
705 726
     #if TEMP_1_PIN > -1
727
+        LCD_MESSAGEPGM("Bed Heating.");
706 728
         if (code_seen('S')) setTargetBed(code_value());
707 729
         codenum = millis(); 
708 730
         while(isHeatingBed()) 
@@ -710,12 +732,17 @@ inline void process_commands()
710 732
           if( (millis()-codenum) > 1000 ) //Print Temp Reading every 1 second while heating up.
711 733
           {
712 734
             float tt=degHotend0();
713
-            SERIAL_PROTOCOLLN("T:"<<tt );
714
-            SERIAL_PROTOCOLLN("ok T:"<<tt <<" B:"<<degBed() ); 
735
+            SERIAL_PROTOCOLPGM("T:");
736
+            SERIAL_PROTOCOLLN(tt );
737
+            SERIAL_PROTOCOLPGM("ok T:");
738
+            SERIAL_PROTOCOL(tt );
739
+            SERIAL_PROTOCOLPGM(" B:");
740
+            SERIAL_PROTOCOLLN(degBed() ); 
715 741
             codenum = millis(); 
716 742
           }
717 743
           manage_heater();
718 744
         }
745
+        LCD_MESSAGEPGM("Bed done.");
719 746
     #endif
720 747
     break;
721 748
 
@@ -759,6 +786,7 @@ inline void process_commands()
759 786
       }
760 787
       else
761 788
       { 
789
+        LCD_MESSAGEPGM("Free move.");
762 790
         st_synchronize(); 
763 791
         disable_x(); 
764 792
         disable_y(); 
@@ -778,50 +806,50 @@ inline void process_commands()
778 806
       }
779 807
       break;
780 808
     case 115: // M115
781
-      SERIAL_PROTOCOLLN("FIRMWARE_NAME:Marlin; Sprinter/grbl mashup for gen6 FIRMWARE_URL:http://www.mendel-parts.com PROTOCOL_VERSION:1.0 MACHINE_TYPE:Mendel EXTRUDER_COUNT:1");
809
+      SerialprintPGM("FIRMWARE_NAME:Marlin; Sprinter/grbl mashup for gen6 FIRMWARE_URL:http://www.mendel-parts.com PROTOCOL_VERSION:1.0 MACHINE_TYPE:Mendel EXTRUDER_COUNT:1");
782 810
       break;
783 811
     case 114: // M114
784
-      SERIAL_PROTOCOL("X:");
812
+      SERIAL_PROTOCOLPGM("X:");
785 813
       SERIAL_PROTOCOL(current_position[X_AXIS]);
786
-      SERIAL_PROTOCOL("Y:");
814
+      SERIAL_PROTOCOLPGM("Y:");
787 815
       SERIAL_PROTOCOL(current_position[Y_AXIS]);
788
-      SERIAL_PROTOCOL("Z:");
816
+      SERIAL_PROTOCOLPGM("Z:");
789 817
       SERIAL_PROTOCOL(current_position[Z_AXIS]);
790
-      SERIAL_PROTOCOL("E:");      
818
+      SERIAL_PROTOCOLPGM("E:");      
791 819
       SERIAL_PROTOCOL(current_position[E_AXIS]);
792 820
       #ifdef DEBUG_STEPS
793
-        SERIAL_PROTOCOL(" Count X:");
821
+        SERIAL_PROTOCOLPGM(" Count X:");
794 822
         SERIAL_PROTOCOL(float(count_position[X_AXIS])/axis_steps_per_unit[X_AXIS]);
795
-        SERIAL_PROTOCOL("Y:");
823
+        SERIAL_PROTOCOLPGM("Y:");
796 824
         SERIAL_PROTOCOL(float(count_position[Y_AXIS])/axis_steps_per_unit[Y_AXIS]);
797
-        SERIAL_PROTOCOL("Z:");
825
+        SERIAL_PROTOCOLPGM("Z:");
798 826
         SERIAL_PROTOCOL(float(count_position[Z_AXIS])/axis_steps_per_unit[Z_AXIS]);
799 827
       #endif
800 828
       SERIAL_PROTOCOLLN("");
801 829
       break;
802 830
     case 119: // M119
803 831
       #if (X_MIN_PIN > -1)
804
-        SERIAL_PROTOCOL("x_min:");
832
+        SERIAL_PROTOCOLPGM("x_min:");
805 833
         SERIAL_PROTOCOL(((READ(X_MIN_PIN)^ENDSTOPS_INVERTING)?"H ":"L "));
806 834
       #endif
807 835
       #if (X_MAX_PIN > -1)
808
-        SERIAL_PROTOCOL("x_max:");
836
+        SERIAL_PROTOCOLPGM("x_max:");
809 837
         SERIAL_PROTOCOL(((READ(X_MAX_PIN)^ENDSTOPS_INVERTING)?"H ":"L "));
810 838
       #endif
811 839
       #if (Y_MIN_PIN > -1)
812
-        SERIAL_PROTOCOL("y_min:");
840
+        SERIAL_PROTOCOLPGM("y_min:");
813 841
         SERIAL_PROTOCOL(((READ(Y_MIN_PIN)^ENDSTOPS_INVERTING)?"H ":"L "));
814 842
       #endif
815 843
       #if (Y_MAX_PIN > -1)
816
-        SERIAL_PROTOCOL("y_max:");
844
+        SERIAL_PROTOCOLPGM("y_max:");
817 845
         SERIAL_PROTOCOL(((READ(Y_MAX_PIN)^ENDSTOPS_INVERTING)?"H ":"L "));
818 846
       #endif
819 847
       #if (Z_MIN_PIN > -1)
820
-        SERIAL_PROTOCOL("z_min:");
848
+        SERIAL_PROTOCOLPGM("z_min:");
821 849
         SERIAL_PROTOCOL(((READ(Z_MIN_PIN)^ENDSTOPS_INVERTING)?"H ":"L "));
822 850
       #endif
823 851
       #if (Z_MAX_PIN > -1)
824
-        SERIAL_PROTOCOL("z_max:");
852
+        SERIAL_PROTOCOLPGM("z_max:");
825 853
         SERIAL_PROTOCOL(((READ(Z_MAX_PIN)^ENDSTOPS_INVERTING)?"H ":"L "));
826 854
       #endif
827 855
       SERIAL_PROTOCOLLN("");
@@ -897,7 +925,10 @@ inline void process_commands()
897 925
   }
898 926
   else
899 927
   {
900
-    SERIAL_ECHOLN("Unknown command:\""<<cmdbuffer[bufindr]<<"\"");
928
+    SERIAL_ECHO_START;
929
+    SERIAL_ECHOPGM("Unknown command:\"");
930
+    SERIAL_ECHO(cmdbuffer[bufindr]);
931
+    SERIAL_ECHOLNPGM("\"");
901 932
   }
902 933
 
903 934
   ClearToSend();
@@ -907,7 +938,8 @@ void FlushSerialRequestResend()
907 938
 {
908 939
   //char cmdbuffer[bufindr][100]="Resend:";
909 940
   Serial.flush();
910
-  SERIAL_PROTOCOLLN("Resend:"<<gcode_LastN + 1);
941
+  SERIAL_PROTOCOLPGM("Resend:");
942
+  SERIAL_PROTOCOLLN(gcode_LastN + 1);
911 943
   ClearToSend();
912 944
 }
913 945
 
@@ -918,7 +950,7 @@ void ClearToSend()
918 950
   if(fromsd[bufindr])
919 951
     return;
920 952
   #endif //SDSUPPORT
921
-  SERIAL_PROTOCOLLN("ok"); 
953
+  SERIAL_PROTOCOLLNPGM("ok"); 
922 954
 }
923 955
 
924 956
 inline void get_coordinates()
@@ -992,7 +1024,9 @@ void kill()
992 1024
   disable_e();
993 1025
   
994 1026
   if(PS_ON_PIN > -1) pinMode(PS_ON_PIN,INPUT);
995
-  SERIAL_ERRORLN("Printer halted. kill() called !!");
1027
+  SERIAL_ERROR_START;
1028
+  SERIAL_ERRORLNPGM("Printer halted. kill() called !!");
1029
+  LCD_MESSAGEPGM("KILLED. ");
996 1030
   while(1); // Wait for reset
997 1031
 }
998 1032
 

+ 2
- 2
Marlin/cardreader.h 查看文件

@@ -30,8 +30,8 @@ public:
30 30
   
31 31
 
32 32
   inline void ls() {root.ls();};
33
-  inline bool eof() { sdpos = file.curPosition();return sdpos>=filesize ;};
34
-  inline char get() {  int16_t n = file.read(); return (n==-1)?'\n':(char)n;};
33
+  inline bool eof() { return sdpos>=filesize ;};
34
+  inline int16_t get() {  sdpos = file.curPosition();return (int16_t)file.read();};
35 35
   inline void setIndex(long index) {sdpos = index;file.seekSet(index);};
36 36
 
37 37
 public:

+ 26
- 12
Marlin/cardreader.pde 查看文件

@@ -29,20 +29,24 @@ void CardReader::initsd()
29 29
     if (!card.init(SPI_FULL_SPEED,SDSS))
30 30
     {
31 31
       //if (!card.init(SPI_HALF_SPEED,SDSS))
32
-      SERIAL_ECHOLN("SD init fail");
32
+      SERIAL_ECHO_START;
33
+      SERIAL_ECHOLNPGM("SD init fail");
33 34
     }
34 35
     else if (!volume.init(&card))
35 36
     {
36
-      SERIAL_ERRORLN("volume.init failed");
37
+      SERIAL_ERROR_START;
38
+      SERIAL_ERRORLNPGM("volume.init failed");
37 39
     }
38 40
     else if (!root.openRoot(&volume)) 
39 41
     {
40
-      SERIAL_ERRORLN("openRoot failed");
42
+      SERIAL_ERROR_START;
43
+      SERIAL_ERRORLNPGM("openRoot failed");
41 44
     }
42 45
     else 
43 46
     {
44 47
       cardOK = true;
45
-      SERIAL_ECHOLN("SD card ok");
48
+      SERIAL_ECHO_START;
49
+      SERIAL_ECHOLNPGM("SD card ok");
46 50
     }
47 51
   #endif //SDSS
48 52
 }
@@ -77,13 +81,16 @@ void CardReader::selectFile(char* name)
77 81
    
78 82
     if (file.open(&root, name, O_READ)) {
79 83
       filesize = file.fileSize();
80
-      SERIAL_PROTOCOLLN("File opened:"<<name<<" Size:"<<filesize);
84
+      SERIAL_PROTOCOLPGM("File opened:");
85
+      SERIAL_PROTOCOL(name);
86
+      SERIAL_PROTOCOLPGM(" Size:");
87
+      SERIAL_PROTOCOLLN(filesize);
81 88
       sdpos = 0;
82 89
       
83
-      SERIAL_PROTOCOLLN("File selected");
90
+      SERIAL_PROTOCOLLNPGM("File selected");
84 91
     }
85 92
     else{
86
-      SERIAL_PROTOCOLLN("file.open failed");
93
+      SERIAL_PROTOCOLLNPGM("file.open failed");
87 94
     }
88 95
   }
89 96
 }
@@ -98,11 +105,14 @@ void CardReader::startFilewrite(char *name)
98 105
     
99 106
     if (!file.open(&root, name, O_CREAT | O_APPEND | O_WRITE | O_TRUNC))
100 107
     {
101
-      SERIAL_PROTOCOLLN("open failed, File: "<<name<<".");
108
+      SERIAL_PROTOCOLPGM("open failed, File: ");
109
+      SERIAL_PROTOCOL(name);
110
+      SERIAL_PROTOCOLLNPGM(".");
102 111
     }
103 112
     else{
104 113
       saving = true;
105
-      SERIAL_PROTOCOLLN("Writing to file: "<<name);
114
+      SERIAL_PROTOCOLPGM("Writing to file: ");
115
+      SERIAL_PROTOCOLLN(name);
106 116
     }
107 117
   }
108 118
 }
@@ -110,10 +120,13 @@ void CardReader::startFilewrite(char *name)
110 120
 void CardReader::getStatus()
111 121
 {
112 122
   if(cardOK){
113
-    SERIAL_PROTOCOLLN("SD printing byte "<<sdpos<<"/"<<filesize);
123
+    SERIAL_PROTOCOLPGM("SD printing byte ");
124
+    SERIAL_PROTOCOL(sdpos);
125
+    SERIAL_PROTOCOLPGM("/");
126
+    SERIAL_PROTOCOLLN(filesize);
114 127
   }
115 128
   else{
116
-    SERIAL_PROTOCOLLN("Not SD printing");
129
+    SERIAL_PROTOCOLLNPGM("Not SD printing");
117 130
   }
118 131
 }
119 132
 void CardReader::write_command(char *buf)
@@ -134,7 +147,8 @@ void CardReader::write_command(char *buf)
134 147
   file.write(begin);
135 148
   if (file.writeError)
136 149
   {
137
-    SERIAL_ERRORLN("error writing to file");
150
+    SERIAL_ERROR_START;
151
+    SERIAL_ERRORLNPGM("error writing to file");
138 152
   }
139 153
 }
140 154
 

+ 3
- 1
Marlin/stepper.cpp 查看文件

@@ -232,7 +232,9 @@ inline void trapezoid_generator_reset() {
232 232
 ISR(TIMER1_COMPA_vect)
233 233
 {        
234 234
   if(busy){ 
235
-    SERIAL_ERRORLN(*(unsigned short *)OCR1A<< " ISR overtaking itself.");
235
+    SERIAL_ERROR_START
236
+    SERIAL_ERROR(*(unsigned short *)OCR1A);
237
+    SERIAL_ERRORLNPGM(" ISR overtaking itself.");
236 238
     return; 
237 239
   } // The busy-flag is used to avoid reentering this interrupt
238 240
 

+ 15
- 8
Marlin/temperature.cpp 查看文件

@@ -160,7 +160,7 @@ void manage_heater()
160 160
         }
161 161
     #endif //PID_OPENLOOP
162 162
     #ifdef PID_DEBUG
163
-     SERIAL_ECHOLN(" PIDDEBUG Input "<<pid_input<<" Output "<<pid_output" pTerm "<<pTerm<<" iTerm "<<iTerm<<" dTerm "<<dTerm);  
163
+     //SERIAL_ECHOLN(" PIDDEBUG Input "<<pid_input<<" Output "<<pid_output" pTerm "<<pTerm<<" iTerm "<<iTerm<<" dTerm "<<dTerm);  
164 164
     #endif //PID_DEBUG
165 165
     analogWrite(HEATER_0_PIN, pid_output);
166 166
   #endif //PIDTEMP
@@ -462,7 +462,8 @@ ISR(TIMER0_COMPB_vect)
462 462
       temp_count++;
463 463
       break;
464 464
     default:
465
-      SERIAL_ERRORLN("Temp measurement error!");
465
+      SERIAL_ERROR_START;
466
+      SERIAL_ERRORLNPGM("Temp measurement error!");
466 467
       break;
467 468
   }
468 469
     
@@ -496,7 +497,8 @@ ISR(TIMER0_COMPB_vect)
496 497
         if(current_raw[TEMPSENSOR_HOTEND_0] >= maxttemp_0) {
497 498
           target_raw[TEMPSENSOR_HOTEND_0] = 0;
498 499
           analogWrite(HEATER_0_PIN, 0);
499
-          SERIAL_ERRORLN("Temperature extruder 0 switched off. MAXTEMP triggered !!");
500
+          SERIAL_ERROR_START;
501
+          SERIAL_ERRORLNPGM("Temperature extruder 0 switched off. MAXTEMP triggered !!");
500 502
           kill();
501 503
         }
502 504
       #endif
@@ -507,7 +509,8 @@ ISR(TIMER0_COMPB_vect)
507 509
         target_raw[TEMPSENSOR_HOTEND_1] = 0;
508 510
       if(current_raw[2] >= maxttemp_1) {
509 511
         analogWrite(HEATER_2_PIN, 0);
510
-        SERIAL_ERRORLN("Temperature extruder 1 switched off. MAXTEMP triggered !!");
512
+        SERIAL_ERROR_START;
513
+        SERIAL_ERRORLNPGM("Temperature extruder 1 switched off. MAXTEMP triggered !!");
511 514
         kill()
512 515
       }
513 516
     #endif
@@ -518,7 +521,8 @@ ISR(TIMER0_COMPB_vect)
518 521
       if(current_raw[TEMPSENSOR_HOTEND_0] <= minttemp_0) {
519 522
         target_raw[TEMPSENSOR_HOTEND_0] = 0;
520 523
         analogWrite(HEATER_0_PIN, 0);
521
-        SERIAL_ERRORLN("Temperature extruder 0 switched off. MINTEMP triggered !!");
524
+        SERIAL_ERROR_START;
525
+        SERIAL_ERRORLNPGM("Temperature extruder 0 switched off. MINTEMP triggered !!");
522 526
         kill();
523 527
       }
524 528
     #endif
@@ -529,7 +533,8 @@ ISR(TIMER0_COMPB_vect)
529 533
       if(current_raw[TEMPSENSOR_HOTEND_1] <= minttemp_1) {
530 534
         target_raw[TEMPSENSOR_HOTEND_1] = 0;
531 535
         analogWrite(HEATER_2_PIN, 0);
532
-        SERIAL_ERRORLN("Temperature extruder 1 switched off. MINTEMP triggered !!");
536
+        SERIAL_ERROR_START;
537
+        SERIAL_ERRORLNPGM("Temperature extruder 1 switched off. MINTEMP triggered !!");
533 538
         kill();
534 539
       }
535 540
     #endif
@@ -540,7 +545,8 @@ ISR(TIMER0_COMPB_vect)
540 545
       if(current_raw[1] <= bed_minttemp) {
541 546
         target_raw[1] = 0;
542 547
         WRITE(HEATER_1_PIN, 0);
543
-        SERIAL_ERRORLN("Temperatur heated bed switched off. MINTEMP triggered !!");
548
+        SERIAL_ERROR_START;
549
+        SERIAL_ERRORLNPGM("Temperatur heated bed switched off. MINTEMP triggered !!");
544 550
         kill();
545 551
       }
546 552
     #endif
@@ -551,7 +557,8 @@ ISR(TIMER0_COMPB_vect)
551 557
       if(current_raw[1] >= bed_maxttemp) {
552 558
         target_raw[1] = 0;
553 559
         WRITE(HEATER_1_PIN, 0);
554
-        SERIAL_ERRORLN("Temperature heated bed switched off. MAXTEMP triggered !!");
560
+        SERIAL_ERROR_START;
561
+        SERIAL_ERRORLNPGM("Temperature heated bed switched off. MAXTEMP triggered !!");
555 562
         kill();
556 563
       }
557 564
     #endif

+ 1
- 0
Marlin/ultralcd.h 查看文件

@@ -83,6 +83,7 @@
83 83
 
84 84
 
85 85
   #define LCD_MESSAGE(x) lcd_status(x);
86
+  #define LCD_MESSAGEPGM(x) lcd_statuspgm(PSTR(x));
86 87
   #define LCD_STATUS lcd_status()
87 88
 #else //no lcd
88 89
   #define LCD_STATUS

+ 15
- 2
Marlin/ultralcd.pde 查看文件

@@ -67,6 +67,18 @@ void lcd_status(const char* message)
67 67
   strncpy(messagetext,message,LCD_WIDTH);
68 68
 }
69 69
 
70
+void lcd_statuspgm(const char* message)
71
+{
72
+  char ch=pgm_read_byte(message);
73
+  char *target=messagetext;
74
+  while(ch)
75
+  {
76
+    *target=ch;
77
+    target++;
78
+    ch=pgm_read_byte(++message);
79
+  }
80
+}
81
+
70 82
 inline void clear()
71 83
 {
72 84
   lcd.clear();
@@ -105,7 +117,7 @@ void lcd_init()
105 117
   lcd.createChar(2,Thermometer);
106 118
   lcd.createChar(3,uplevel);
107 119
   lcd.createChar(4,refresh);
108
-  LCD_MESSAGE(fillto(LCD_WIDTH,"UltiMarlin ready."));
120
+  LCD_MESSAGEPGM("UltiMarlin ready.");
109 121
 }
110 122
 
111 123
 
@@ -1369,7 +1381,8 @@ void MainMenu::showMainMenu()
1369 1381
       }break;
1370 1382
       #endif
1371 1383
       default: 
1372
-        SERIAL_ERRORLN("Something is wrong in the MenuStructure.");
1384
+        SERIAL_ERROR_START;
1385
+        SERIAL_ERRORLNPGM("Something is wrong in the MenuStructure.");
1373 1386
       break;
1374 1387
     }
1375 1388
   }

+ 4
- 3
Marlin/watchdog.pde 查看文件

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

正在加载...
取消
保存