Browse Source

Merge pull request #3565 from thinkyhead/rc_look_at_3563

Output error message for M303 if PIDTEMP is disabled
pull/1/head
Scott Lahteine 9 years ago
parent
commit
dd94ce5bd5
  1. 5
      Marlin/Marlin_main.cpp
  2. 1
      Marlin/language.h
  3. 4
      Marlin/temperature.cpp
  4. 2
      Marlin/temperature.h

5
Marlin/Marlin_main.cpp

@ -5559,6 +5559,7 @@ inline void gcode_M226() {
* U<bool> with a non-zero value will apply the result to current settings
*/
inline void gcode_M303() {
#if ENABLED(PIDTEMP)
int e = code_seen('E') ? code_value_short() : 0;
int c = code_seen('C') ? code_value_short() : 5;
bool u = code_seen('U') && code_value_short() != 0;
@ -5573,6 +5574,10 @@ inline void gcode_M303() {
PID_autotune(temp, e, c, u);
KEEPALIVE_STATE(IN_HANDLER);
#else
SERIAL_ERROR_START;
SERIAL_ERRORLNPGM(MSG_ERR_M303_DISABLED);
#endif
}
#if ENABLED(SCARA)

1
Marlin/language.h

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

4
Marlin/temperature.cpp

@ -221,6 +221,8 @@ static void updateTemperaturesFromRawValues();
//================================ Functions ================================
//===========================================================================
#if ENABLED(PIDTEMP)
void PID_autotune(float temp, int extruder, int ncycles, bool set_result/*=false*/) {
float input = 0.0;
int cycles = 0;
@ -392,6 +394,8 @@ void PID_autotune(float temp, int extruder, int ncycles, bool set_result/*=false
}
}
#endif // PIDTEMP
void updatePID() {
#if ENABLED(PIDTEMP)
for (int e = 0; e < EXTRUDERS; e++) {

2
Marlin/temperature.h

@ -169,7 +169,9 @@ int getHeaterPower(int heater);
void disable_all_heaters();
void updatePID();
#if ENABLED(PIDTEMP)
void PID_autotune(float temp, int extruder, int ncycles, bool set_result=false);
#endif
void setExtruderAutoFanState(int pin, bool state);
void checkExtruderAutoFans();

Loading…
Cancel
Save