Browse Source

Print error for M42 bad pin

pull/1/head
Scott Lahteine 8 years ago
parent
commit
c6dd539c84
  1. 6
      Marlin/Marlin_main.cpp
  2. 1
      Marlin/language.h

6
Marlin/Marlin_main.cpp

@ -4230,7 +4230,11 @@ inline void gcode_M42() {
if (pin_number < 0) return; if (pin_number < 0) return;
for (uint8_t i = 0; i < COUNT(sensitive_pins); i++) for (uint8_t i = 0; i < COUNT(sensitive_pins); i++)
if (pin_number == sensitive_pins[i]) return; if (pin_number == sensitive_pins[i]) {
SERIAL_ERROR_START;
SERIAL_ERRORLNPGM(MSG_ERR_PROTECTED_PIN);
return;
}
pinMode(pin_number, OUTPUT); pinMode(pin_number, OUTPUT);
digitalWrite(pin_number, pin_status); digitalWrite(pin_number, pin_status);

1
Marlin/language.h

@ -151,6 +151,7 @@
#define MSG_ERR_M421_PARAMETERS "M421 requires XYZ or IJZ parameters" #define MSG_ERR_M421_PARAMETERS "M421 requires XYZ or IJZ parameters"
#define MSG_ERR_MESH_XY "Mesh XY or IJ cannot be resolved" #define MSG_ERR_MESH_XY "Mesh XY or IJ cannot be resolved"
#define MSG_ERR_ARC_ARGS "G2/G3 bad parameters" #define MSG_ERR_ARC_ARGS "G2/G3 bad parameters"
#define MSG_ERR_PROTECTED_PIN "Protected Pin"
#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_ERR_M303_DISABLED "PIDTEMP disabled"
#define MSG_M119_REPORT "Reporting endstop status" #define MSG_M119_REPORT "Reporting endstop status"

Loading…
Cancel
Save