Browse Source

added M503 to display eeprom storage, and renamed eeprom routings. This version is compatible with the qtmarlin eeprom-tab.

Bernhard 13 years ago
parent
commit
cf50ba140f
3 changed files with 73 additions and 58 deletions
  1. 60
    51
      Marlin/EEPROMwrite.h
  2. 10
    4
      Marlin/Marlin.pde
  3. 3
    3
      Marlin/ultralcd.pde

+ 60
- 51
Marlin/EEPROMwrite.h View File

@@ -39,7 +39,7 @@ template <class T> int EEPROM_readAnything(int &ee, T& value)
39 39
 // ALSO:  always make sure the variables in the Store and retrieve sections are in the same order.
40 40
 #define EEPROM_VERSION "V04"  
41 41
 
42
-FORCE_INLINE void StoreSettings() 
42
+inline void EEPROM_StoreSettings() 
43 43
 {
44 44
 #ifdef EEPROM_SETTINGS
45 45
   char ver[4]= "000";
@@ -72,7 +72,64 @@ FORCE_INLINE void StoreSettings()
72 72
 #endif //EEPROM_SETTINGS
73 73
 }
74 74
 
75
-FORCE_INLINE void RetrieveSettings(bool def=false)
75
+
76
+inline void EEPROM_printSettings()
77
+{  // if def=true, the default values will be used
78
+  #ifdef EEPROM_SETTINGS  
79
+      SERIAL_ECHO_START;
80
+      SERIAL_ECHOLNPGM("Steps per unit:");
81
+      SERIAL_ECHO_START;
82
+      SERIAL_ECHOPAIR("  M92 X",axis_steps_per_unit[0]);
83
+      SERIAL_ECHOPAIR(" Y",axis_steps_per_unit[1]);
84
+      SERIAL_ECHOPAIR(" Z",axis_steps_per_unit[2]);
85
+      SERIAL_ECHOPAIR(" E",axis_steps_per_unit[3]);
86
+      SERIAL_ECHOLN("");
87
+      
88
+    SERIAL_ECHO_START;
89
+      SERIAL_ECHOLNPGM("Maximum feedrates (mm/s):");
90
+      SERIAL_ECHO_START;
91
+      SERIAL_ECHOPAIR("  M203 X",max_feedrate[0]);
92
+      SERIAL_ECHOPAIR(" Y",max_feedrate[1] ); 
93
+      SERIAL_ECHOPAIR(" Z", max_feedrate[2] ); 
94
+      SERIAL_ECHOPAIR(" E", max_feedrate[3]);
95
+      SERIAL_ECHOLN("");
96
+    SERIAL_ECHO_START;
97
+      SERIAL_ECHOLNPGM("Maximum Acceleration (mm/s2):");
98
+      SERIAL_ECHO_START;
99
+      SERIAL_ECHOPAIR("  M201 X" ,max_acceleration_units_per_sq_second[0] ); 
100
+      SERIAL_ECHOPAIR(" Y" , max_acceleration_units_per_sq_second[1] ); 
101
+      SERIAL_ECHOPAIR(" Z" ,max_acceleration_units_per_sq_second[2] );
102
+      SERIAL_ECHOPAIR(" E" ,max_acceleration_units_per_sq_second[3]);
103
+      SERIAL_ECHOLN("");
104
+    SERIAL_ECHO_START;
105
+      SERIAL_ECHOLNPGM("Acceleration: S=acceleration, T=retract acceleration");
106
+      SERIAL_ECHO_START;
107
+      SERIAL_ECHOPAIR("  M204 S",acceleration ); 
108
+      SERIAL_ECHOPAIR(" T" ,retract_acceleration);
109
+      SERIAL_ECHOLN("");
110
+    SERIAL_ECHO_START;
111
+      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)");
112
+      SERIAL_ECHO_START;
113
+      SERIAL_ECHOPAIR("  M205 S",minimumfeedrate ); 
114
+      SERIAL_ECHOPAIR(" T" ,mintravelfeedrate ); 
115
+      SERIAL_ECHOPAIR(" B" ,minsegmenttime ); 
116
+      SERIAL_ECHOPAIR(" X" ,max_xy_jerk ); 
117
+      SERIAL_ECHOPAIR(" Z" ,max_z_jerk);
118
+      SERIAL_ECHOLN(""); 
119
+    #ifdef PIDTEMP
120
+      SERIAL_ECHO_START;
121
+      SERIAL_ECHOLNPGM("PID settings:");
122
+      SERIAL_ECHO_START;
123
+      SERIAL_ECHOPAIR("   M301 P",Kp); 
124
+      SERIAL_ECHOPAIR(" I" ,Ki/PID_dT); 
125
+      SERIAL_ECHOPAIR(" D" ,Kd*PID_dT);
126
+      SERIAL_ECHOLN(""); 
127
+    #endif
128
+  #endif
129
+} 
130
+
131
+
132
+inline void EEPROM_RetrieveSettings(bool def=false)
76 133
 {  // if def=true, the default values will be used
77 134
   #ifdef EEPROM_SETTINGS
78 135
     int i=EEPROM_OFFSET;
@@ -125,55 +182,7 @@ FORCE_INLINE void RetrieveSettings(bool def=false)
125 182
       SERIAL_ECHOLN("Using Default settings:");
126 183
     }
127 184
   #ifdef EEPROM_CHITCHAT
128
-    SERIAL_ECHO_START;
129
-      SERIAL_ECHOLNPGM("Steps per unit:");
130
-      SERIAL_ECHO_START;
131
-      SERIAL_ECHOPAIR("  M92 X",axis_steps_per_unit[0]);
132
-      SERIAL_ECHOPAIR(" Y",axis_steps_per_unit[1]);
133
-      SERIAL_ECHOPAIR(" Z",axis_steps_per_unit[2]);
134
-      SERIAL_ECHOPAIR(" E",axis_steps_per_unit[3]);
135
-      SERIAL_ECHOLN("");
136
-      
137
-    SERIAL_ECHO_START;
138
-      SERIAL_ECHOLNPGM("Maximum feedrates (mm/s):");
139
-      SERIAL_ECHO_START;
140
-      SERIAL_ECHOPAIR("  M203 X",max_feedrate[0]);
141
-      SERIAL_ECHOPAIR(" Y",max_feedrate[1] ); 
142
-      SERIAL_ECHOPAIR(" Z", max_feedrate[2] ); 
143
-      SERIAL_ECHOPAIR(" E", max_feedrate[3]);
144
-      SERIAL_ECHOLN("");
145
-    SERIAL_ECHO_START;
146
-      SERIAL_ECHOLNPGM("Maximum Acceleration (mm/s2):");
147
-      SERIAL_ECHO_START;
148
-      SERIAL_ECHOPAIR("  M201 X" ,max_acceleration_units_per_sq_second[0] ); 
149
-      SERIAL_ECHOPAIR(" Y" , max_acceleration_units_per_sq_second[1] ); 
150
-      SERIAL_ECHOPAIR(" Z" ,max_acceleration_units_per_sq_second[2] );
151
-      SERIAL_ECHOPAIR(" E" ,max_acceleration_units_per_sq_second[3]);
152
-      SERIAL_ECHOLN("");
153
-    SERIAL_ECHO_START;
154
-      SERIAL_ECHOLNPGM("Acceleration: S=acceleration, T=retract acceleration");
155
-      SERIAL_ECHO_START;
156
-      SERIAL_ECHOPAIR("  M204 S",acceleration ); 
157
-      SERIAL_ECHOPAIR(" T" ,retract_acceleration);
158
-      SERIAL_ECHOLN("");
159
-    SERIAL_ECHO_START;
160
-      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)");
161
-      SERIAL_ECHO_START;
162
-      SERIAL_ECHOPAIR("  M205 S",minimumfeedrate ); 
163
-      SERIAL_ECHOPAIR(" T" ,mintravelfeedrate ); 
164
-      SERIAL_ECHOPAIR(" B" ,minsegmenttime ); 
165
-      SERIAL_ECHOPAIR(" X" ,max_xy_jerk ); 
166
-      SERIAL_ECHOPAIR(" Z" ,max_z_jerk);
167
-      SERIAL_ECHOLN(""); 
168
-    #ifdef PIDTEMP
169
-      SERIAL_ECHO_START;
170
-      SERIAL_ECHOLNPGM("PID settings:");
171
-      SERIAL_ECHO_START;
172
-      SERIAL_ECHOPAIR("   M301 P",Kp); 
173
-      SERIAL_ECHOPAIR(" I" ,Ki/PID_dT); 
174
-      SERIAL_ECHOPAIR(" D" ,Kd*PID_dT);
175
-      SERIAL_ECHOLN(""); 
176
-    #endif
185
+    EEPROM_printSettings();
177 186
   #endif
178 187
 }  
179 188
 

+ 10
- 4
Marlin/Marlin.pde View File

@@ -112,6 +112,7 @@
112 112
 // M500 - stores paramters in EEPROM
113 113
 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).  
114 114
 // M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
115
+// M503 - print the current settings (from memory not from eeprom)
115 116
 
116 117
 //Stepper Movement Variables
117 118
 
@@ -236,7 +237,7 @@ void setup()
236 237
     fromsd[i] = false;
237 238
   }
238 239
   
239
-  RetrieveSettings(); // loads data from EEPROM if available
240
+  EEPROM_RetrieveSettings(); // loads data from EEPROM if available
240 241
 
241 242
   for(int8_t i=0; i < NUM_AXIS; i++)
242 243
   {
@@ -1034,17 +1035,22 @@ FORCE_INLINE void process_commands()
1034 1035
     break;
1035 1036
     case 500: // Store settings in EEPROM
1036 1037
     {
1037
-        StoreSettings();
1038
+        EEPROM_StoreSettings();
1038 1039
     }
1039 1040
     break;
1040 1041
     case 501: // Read settings from EEPROM
1041 1042
     {
1042
-      RetrieveSettings();
1043
+      EEPROM_RetrieveSettings();
1043 1044
     }
1044 1045
     break;
1045 1046
     case 502: // Revert to default settings
1046 1047
     {
1047
-      RetrieveSettings(true);
1048
+      EEPROM_RetrieveSettings(true);
1049
+    }
1050
+    break;
1051
+    case 503: // print settings currently in memory
1052
+    {
1053
+      EEPROM_printSettings();
1048 1054
     }
1049 1055
     break;
1050 1056
 

+ 3
- 3
Marlin/ultralcd.pde View File

@@ -1402,7 +1402,7 @@ void MainMenu::showControl()
1402 1402
         //enquecommand("M84");
1403 1403
         beepshort();
1404 1404
         BLOCK;
1405
-        StoreSettings();
1405
+        EEPROM_StoreSettings();
1406 1406
       }
1407 1407
     }break;
1408 1408
     case ItemC_load:
@@ -1416,7 +1416,7 @@ void MainMenu::showControl()
1416 1416
         //enquecommand("M84");
1417 1417
         beepshort();
1418 1418
         BLOCK;
1419
-        RetrieveSettings();
1419
+        EEPROM_RetrieveSettings();
1420 1420
       }
1421 1421
     }break;
1422 1422
     case ItemC_failsafe:
@@ -1430,7 +1430,7 @@ void MainMenu::showControl()
1430 1430
         //enquecommand("M84");
1431 1431
         beepshort();
1432 1432
         BLOCK;
1433
-        RetrieveSettings(true);
1433
+        EEPROM_RetrieveSettings(true);
1434 1434
       }
1435 1435
     }break;
1436 1436
     default:   

Loading…
Cancel
Save