Browse Source

Output error for disabled M303

Scott Lahteine 8 years ago
parent
commit
ba66336503
4 changed files with 13 additions and 1 deletions
  1. 5
    0
      Marlin/Marlin_main.cpp
  2. 1
    0
      Marlin/language.h
  3. 4
    0
      Marlin/temperature.cpp
  4. 3
    1
      Marlin/temperature.h

+ 5
- 0
Marlin/Marlin_main.cpp View File

5559
  *       U<bool> with a non-zero value will apply the result to current settings
5559
  *       U<bool> with a non-zero value will apply the result to current settings
5560
  */
5560
  */
5561
 inline void gcode_M303() {
5561
 inline void gcode_M303() {
5562
+#if ENABLED(PIDTEMP)
5562
   int e = code_seen('E') ? code_value_short() : 0;
5563
   int e = code_seen('E') ? code_value_short() : 0;
5563
   int c = code_seen('C') ? code_value_short() : 5;
5564
   int c = code_seen('C') ? code_value_short() : 5;
5564
   bool u = code_seen('U') && code_value_short() != 0;
5565
   bool u = code_seen('U') && code_value_short() != 0;
5573
   PID_autotune(temp, e, c, u);
5574
   PID_autotune(temp, e, c, u);
5574
 
5575
 
5575
   KEEPALIVE_STATE(IN_HANDLER);
5576
   KEEPALIVE_STATE(IN_HANDLER);
5577
+#else
5578
+  SERIAL_ERROR_START;
5579
+  SERIAL_ERRORLNPGM(MSG_ERR_M303_DISABLED);
5580
+#endif
5576
 }
5581
 }
5577
 
5582
 
5578
 #if ENABLED(SCARA)
5583
 #if ENABLED(SCARA)

+ 1
- 0
Marlin/language.h View File

159
 #define MSG_ERR_M421_REQUIRES_XYZ           "M421 requires XYZ parameters"
159
 #define MSG_ERR_M421_REQUIRES_XYZ           "M421 requires XYZ parameters"
160
 #define MSG_ERR_MESH_INDEX_OOB              "Mesh XY index is out of bounds"
160
 #define MSG_ERR_MESH_INDEX_OOB              "Mesh XY index is out of bounds"
161
 #define MSG_ERR_M428_TOO_FAR                "Too far from reference point"
161
 #define MSG_ERR_M428_TOO_FAR                "Too far from reference point"
162
+#define MSG_ERR_M303_DISABLED               "PIDTEMP disabled"
162
 #define MSG_M119_REPORT                     "Reporting endstop status"
163
 #define MSG_M119_REPORT                     "Reporting endstop status"
163
 #define MSG_ENDSTOP_HIT                     "TRIGGERED"
164
 #define MSG_ENDSTOP_HIT                     "TRIGGERED"
164
 #define MSG_ENDSTOP_OPEN                    "open"
165
 #define MSG_ENDSTOP_OPEN                    "open"

+ 4
- 0
Marlin/temperature.cpp View File

221
 //================================ Functions ================================
221
 //================================ Functions ================================
222
 //===========================================================================
222
 //===========================================================================
223
 
223
 
224
+#if ENABLED(PIDTEMP)
225
+
224
 void PID_autotune(float temp, int extruder, int ncycles, bool set_result/*=false*/) {
226
 void PID_autotune(float temp, int extruder, int ncycles, bool set_result/*=false*/) {
225
   float input = 0.0;
227
   float input = 0.0;
226
   int cycles = 0;
228
   int cycles = 0;
392
   }
394
   }
393
 }
395
 }
394
 
396
 
397
+#endif // PIDTEMP
398
+
395
 void updatePID() {
399
 void updatePID() {
396
   #if ENABLED(PIDTEMP)
400
   #if ENABLED(PIDTEMP)
397
     for (int e = 0; e < EXTRUDERS; e++) {
401
     for (int e = 0; e < EXTRUDERS; e++) {

+ 3
- 1
Marlin/temperature.h View File

169
 void disable_all_heaters();
169
 void disable_all_heaters();
170
 void updatePID();
170
 void updatePID();
171
 
171
 
172
-void PID_autotune(float temp, int extruder, int ncycles, bool set_result=false);
172
+#if ENABLED(PIDTEMP)
173
+  void PID_autotune(float temp, int extruder, int ncycles, bool set_result=false);
174
+#endif
173
 
175
 
174
 void setExtruderAutoFanState(int pin, bool state);
176
 void setExtruderAutoFanState(int pin, bool state);
175
 void checkExtruderAutoFans();
177
 void checkExtruderAutoFans();

Loading…
Cancel
Save