Merge pull request #3565 from thinkyhead/rc_look_at_3563
Output error message for M303 if PIDTEMP is disabled
This commit is contained in:
commit
dd94ce5bd5
4 changed files with 172 additions and 160 deletions
|
@ -5559,6 +5559,7 @@ inline void gcode_M226() {
|
||||||
* U<bool> with a non-zero value will apply the result to current settings
|
* U<bool> with a non-zero value will apply the result to current settings
|
||||||
*/
|
*/
|
||||||
inline void gcode_M303() {
|
inline void gcode_M303() {
|
||||||
|
#if ENABLED(PIDTEMP)
|
||||||
int e = code_seen('E') ? code_value_short() : 0;
|
int e = code_seen('E') ? code_value_short() : 0;
|
||||||
int c = code_seen('C') ? code_value_short() : 5;
|
int c = code_seen('C') ? code_value_short() : 5;
|
||||||
bool u = code_seen('U') && code_value_short() != 0;
|
bool u = code_seen('U') && code_value_short() != 0;
|
||||||
|
@ -5573,6 +5574,10 @@ inline void gcode_M303() {
|
||||||
PID_autotune(temp, e, c, u);
|
PID_autotune(temp, e, c, u);
|
||||||
|
|
||||||
KEEPALIVE_STATE(IN_HANDLER);
|
KEEPALIVE_STATE(IN_HANDLER);
|
||||||
|
#else
|
||||||
|
SERIAL_ERROR_START;
|
||||||
|
SERIAL_ERRORLNPGM(MSG_ERR_M303_DISABLED);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLED(SCARA)
|
#if ENABLED(SCARA)
|
||||||
|
|
|
@ -159,6 +159,7 @@
|
||||||
#define MSG_ERR_M421_REQUIRES_XYZ "M421 requires XYZ parameters"
|
#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_MESH_INDEX_OOB "Mesh XY index is out of bounds"
|
||||||
#define MSG_ERR_M428_TOO_FAR "Too far from reference point"
|
#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_M119_REPORT "Reporting endstop status"
|
||||||
#define MSG_ENDSTOP_HIT "TRIGGERED"
|
#define MSG_ENDSTOP_HIT "TRIGGERED"
|
||||||
#define MSG_ENDSTOP_OPEN "open"
|
#define MSG_ENDSTOP_OPEN "open"
|
||||||
|
|
|
@ -221,7 +221,9 @@ static void updateTemperaturesFromRawValues();
|
||||||
//================================ Functions ================================
|
//================================ Functions ================================
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
void PID_autotune(float temp, int extruder, int ncycles, bool set_result/*=false*/) {
|
#if ENABLED(PIDTEMP)
|
||||||
|
|
||||||
|
void PID_autotune(float temp, int extruder, int ncycles, bool set_result/*=false*/) {
|
||||||
float input = 0.0;
|
float input = 0.0;
|
||||||
int cycles = 0;
|
int cycles = 0;
|
||||||
bool heating = true;
|
bool heating = true;
|
||||||
|
@ -390,7 +392,9 @@ void PID_autotune(float temp, int extruder, int ncycles, bool set_result/*=false
|
||||||
}
|
}
|
||||||
lcd_update();
|
lcd_update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // PIDTEMP
|
||||||
|
|
||||||
void updatePID() {
|
void updatePID() {
|
||||||
#if ENABLED(PIDTEMP)
|
#if ENABLED(PIDTEMP)
|
||||||
|
|
|
@ -169,7 +169,9 @@ int getHeaterPower(int heater);
|
||||||
void disable_all_heaters();
|
void disable_all_heaters();
|
||||||
void updatePID();
|
void updatePID();
|
||||||
|
|
||||||
void PID_autotune(float temp, int extruder, int ncycles, bool set_result=false);
|
#if ENABLED(PIDTEMP)
|
||||||
|
void PID_autotune(float temp, int extruder, int ncycles, bool set_result=false);
|
||||||
|
#endif
|
||||||
|
|
||||||
void setExtruderAutoFanState(int pin, bool state);
|
void setExtruderAutoFanState(int pin, bool state);
|
||||||
void checkExtruderAutoFans();
|
void checkExtruderAutoFans();
|
||||||
|
|
Reference in a new issue