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,6 +5559,7 @@ inline void gcode_M226() {
5559 5559
  *       U<bool> with a non-zero value will apply the result to current settings
5560 5560
  */
5561 5561
 inline void gcode_M303() {
5562
+#if ENABLED(PIDTEMP)
5562 5563
   int e = code_seen('E') ? code_value_short() : 0;
5563 5564
   int c = code_seen('C') ? code_value_short() : 5;
5564 5565
   bool u = code_seen('U') && code_value_short() != 0;
@@ -5573,6 +5574,10 @@ inline void gcode_M303() {
5573 5574
   PID_autotune(temp, e, c, u);
5574 5575
 
5575 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 5583
 #if ENABLED(SCARA)

+ 1
- 0
Marlin/language.h View File

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

+ 4
- 0
Marlin/temperature.cpp View File

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

+ 3
- 1
Marlin/temperature.h View File

@@ -169,7 +169,9 @@ int getHeaterPower(int heater);
169 169
 void disable_all_heaters();
170 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 176
 void setExtruderAutoFanState(int pin, bool state);
175 177
 void checkExtruderAutoFans();

Loading…
Cancel
Save