|
|
@ -284,7 +284,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(M100_FREE_MEMORY_WATCHER)
|
|
|
|
#if ENABLED(M100_FREE_MEMORY_WATCHER)
|
|
|
|
void gcode_M100();
|
|
|
|
void gcode_M100();
|
|
|
|
void M100_dump_routine( char *title, char *start, char *end);
|
|
|
|
void M100_dump_routine(const char * const title, const char *start, const char *end);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(SDSUPPORT)
|
|
|
|
#if ENABLED(SDSUPPORT)
|
|
|
@ -1091,7 +1091,7 @@ inline void get_serial_commands() {
|
|
|
|
if (IsStopped()) {
|
|
|
|
if (IsStopped()) {
|
|
|
|
char* gpos = strchr(command, 'G');
|
|
|
|
char* gpos = strchr(command, 'G');
|
|
|
|
if (gpos) {
|
|
|
|
if (gpos) {
|
|
|
|
int codenum = strtol(gpos + 1, NULL, 10);
|
|
|
|
const int codenum = strtol(gpos + 1, NULL, 10);
|
|
|
|
switch (codenum) {
|
|
|
|
switch (codenum) {
|
|
|
|
case 0:
|
|
|
|
case 0:
|
|
|
|
case 1:
|
|
|
|
case 1:
|
|
|
@ -4167,17 +4167,25 @@ inline void gcode_G28() {
|
|
|
|
#define ABL_VAR
|
|
|
|
#define ABL_VAR
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
ABL_VAR int verbose_level, abl_probe_index;
|
|
|
|
ABL_VAR int verbose_level;
|
|
|
|
ABL_VAR float xProbe, yProbe, measured_z;
|
|
|
|
ABL_VAR float xProbe, yProbe, measured_z;
|
|
|
|
ABL_VAR bool dryrun, abl_should_enable;
|
|
|
|
ABL_VAR bool dryrun, abl_should_enable;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(PROBE_MANUALLY) || ENABLED(AUTO_BED_LEVELING_LINEAR)
|
|
|
|
|
|
|
|
ABL_VAR int abl_probe_index;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_SOFTWARE_ENDSTOPS
|
|
|
|
#if HAS_SOFTWARE_ENDSTOPS
|
|
|
|
ABL_VAR bool enable_soft_endstops = true;
|
|
|
|
ABL_VAR bool enable_soft_endstops = true;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if ABL_GRID
|
|
|
|
#if ABL_GRID
|
|
|
|
ABL_VAR uint8_t PR_OUTER_VAR;
|
|
|
|
|
|
|
|
ABL_VAR int8_t PR_INNER_VAR;
|
|
|
|
#if ENABLED(PROBE_MANUALLY)
|
|
|
|
|
|
|
|
ABL_VAR uint8_t PR_OUTER_VAR;
|
|
|
|
|
|
|
|
ABL_VAR int8_t PR_INNER_VAR;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
ABL_VAR int left_probe_bed_position, right_probe_bed_position, front_probe_bed_position, back_probe_bed_position;
|
|
|
|
ABL_VAR int left_probe_bed_position, right_probe_bed_position, front_probe_bed_position, back_probe_bed_position;
|
|
|
|
ABL_VAR float xGridSpacing, yGridSpacing;
|
|
|
|
ABL_VAR float xGridSpacing, yGridSpacing;
|
|
|
|
|
|
|
|
|
|
|
@ -4186,13 +4194,18 @@ inline void gcode_G28() {
|
|
|
|
#if ABL_PLANAR
|
|
|
|
#if ABL_PLANAR
|
|
|
|
ABL_VAR uint8_t abl_grid_points_x = GRID_MAX_POINTS_X,
|
|
|
|
ABL_VAR uint8_t abl_grid_points_x = GRID_MAX_POINTS_X,
|
|
|
|
abl_grid_points_y = GRID_MAX_POINTS_Y;
|
|
|
|
abl_grid_points_y = GRID_MAX_POINTS_Y;
|
|
|
|
ABL_VAR int abl2;
|
|
|
|
|
|
|
|
ABL_VAR bool do_topography_map;
|
|
|
|
ABL_VAR bool do_topography_map;
|
|
|
|
#else // 3-point
|
|
|
|
#else // 3-point
|
|
|
|
uint8_t constexpr abl_grid_points_x = GRID_MAX_POINTS_X,
|
|
|
|
uint8_t constexpr abl_grid_points_x = GRID_MAX_POINTS_X,
|
|
|
|
abl_grid_points_y = GRID_MAX_POINTS_Y;
|
|
|
|
abl_grid_points_y = GRID_MAX_POINTS_Y;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
int constexpr abl2 = ABL_GRID_MAX;
|
|
|
|
#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(PROBE_MANUALLY)
|
|
|
|
|
|
|
|
#if ABL_PLANAR
|
|
|
|
|
|
|
|
ABL_VAR int abl2;
|
|
|
|
|
|
|
|
#else // 3-point
|
|
|
|
|
|
|
|
int constexpr abl2 = ABL_GRID_MAX;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(AUTO_BED_LEVELING_BILINEAR)
|
|
|
|
#if ENABLED(AUTO_BED_LEVELING_BILINEAR)
|
|
|
@ -4224,7 +4237,10 @@ inline void gcode_G28() {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
if (!g29_in_progress) {
|
|
|
|
if (!g29_in_progress) {
|
|
|
|
|
|
|
|
|
|
|
|
abl_probe_index = 0;
|
|
|
|
#if ENABLED(PROBE_MANUALLY) || ENABLED(AUTO_BED_LEVELING_LINEAR)
|
|
|
|
|
|
|
|
abl_probe_index = 0;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
abl_should_enable = planner.abl_enabled;
|
|
|
|
abl_should_enable = planner.abl_enabled;
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(AUTO_BED_LEVELING_BILINEAR)
|
|
|
|
#if ENABLED(AUTO_BED_LEVELING_BILINEAR)
|
|
|
@ -4284,7 +4300,7 @@ inline void gcode_G28() {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
dryrun = code_seen('D') ? code_value_bool() : false;
|
|
|
|
dryrun = code_seen('D') && code_value_bool();
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(AUTO_BED_LEVELING_LINEAR)
|
|
|
|
#if ENABLED(AUTO_BED_LEVELING_LINEAR)
|
|
|
|
|
|
|
|
|
|
|
@ -4455,7 +4471,7 @@ inline void gcode_G28() {
|
|
|
|
g29_in_progress = true;
|
|
|
|
g29_in_progress = true;
|
|
|
|
|
|
|
|
|
|
|
|
if (abl_probe_index == 0) {
|
|
|
|
if (abl_probe_index == 0) {
|
|
|
|
// For the initial G29 S2 save software endstop state
|
|
|
|
// For the initial G29 save software endstop state
|
|
|
|
#if HAS_SOFTWARE_ENDSTOPS
|
|
|
|
#if HAS_SOFTWARE_ENDSTOPS
|
|
|
|
enable_soft_endstops = soft_endstops_enabled;
|
|
|
|
enable_soft_endstops = soft_endstops_enabled;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -4586,7 +4602,6 @@ inline void gcode_G28() {
|
|
|
|
|
|
|
|
|
|
|
|
#else // !PROBE_MANUALLY
|
|
|
|
#else // !PROBE_MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool stow_probe_after_each = code_seen('E');
|
|
|
|
bool stow_probe_after_each = code_seen('E');
|
|
|
|
|
|
|
|
|
|
|
|
#if ABL_GRID
|
|
|
|
#if ABL_GRID
|
|
|
@ -4927,14 +4942,12 @@ inline void gcode_G28() {
|
|
|
|
* S = Stows the probe if 1 (default=1)
|
|
|
|
* S = Stows the probe if 1 (default=1)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
inline void gcode_G30() {
|
|
|
|
inline void gcode_G30() {
|
|
|
|
float X_probe_location = code_seen('X') ? code_value_linear_units() : current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER,
|
|
|
|
const float xpos = code_seen('X') ? code_value_linear_units() : current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER,
|
|
|
|
Y_probe_location = code_seen('Y') ? code_value_linear_units() : current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER;
|
|
|
|
ypos = code_seen('Y') ? code_value_linear_units() : current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER,
|
|
|
|
|
|
|
|
pos[XYZ] = { xpos, ypos, LOGICAL_Z_POSITION(0) };
|
|
|
|
|
|
|
|
|
|
|
|
float pos[XYZ] = { X_probe_location, Y_probe_location, LOGICAL_Z_POSITION(0) };
|
|
|
|
|
|
|
|
if (!position_is_reachable(pos, true)) return;
|
|
|
|
if (!position_is_reachable(pos, true)) return;
|
|
|
|
|
|
|
|
|
|
|
|
bool stow = code_seen('S') ? code_value_bool() : true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Disable leveling so the planner won't mess with us
|
|
|
|
// Disable leveling so the planner won't mess with us
|
|
|
|
#if PLANNER_LEVELING
|
|
|
|
#if PLANNER_LEVELING
|
|
|
|
set_bed_leveling_enabled(false);
|
|
|
|
set_bed_leveling_enabled(false);
|
|
|
@ -4942,14 +4955,11 @@ inline void gcode_G28() {
|
|
|
|
|
|
|
|
|
|
|
|
setup_for_endstop_or_probe_move();
|
|
|
|
setup_for_endstop_or_probe_move();
|
|
|
|
|
|
|
|
|
|
|
|
float measured_z = probe_pt(X_probe_location, Y_probe_location, stow, 1);
|
|
|
|
const float measured_z = probe_pt(xpos, ypos, !code_seen('S') || code_value_bool(), 1);
|
|
|
|
|
|
|
|
|
|
|
|
SERIAL_PROTOCOLPGM("Bed X: ");
|
|
|
|
SERIAL_PROTOCOLPAIR("Bed X: ", FIXFLOAT(xpos));
|
|
|
|
SERIAL_PROTOCOL(FIXFLOAT(X_probe_location));
|
|
|
|
SERIAL_PROTOCOLPAIR(" Y: ", FIXFLOAT(ypos));
|
|
|
|
SERIAL_PROTOCOLPGM(" Y: ");
|
|
|
|
SERIAL_PROTOCOLLNPAIR(" Z: ", FIXFLOAT(measured_z));
|
|
|
|
SERIAL_PROTOCOL(FIXFLOAT(Y_probe_location));
|
|
|
|
|
|
|
|
SERIAL_PROTOCOLPGM(" Z: ");
|
|
|
|
|
|
|
|
SERIAL_PROTOCOLLN(FIXFLOAT(measured_z));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
clean_up_after_endstop_or_probe_move();
|
|
|
|
clean_up_after_endstop_or_probe_move();
|
|
|
|
|
|
|
|
|
|
|
@ -5466,7 +5476,7 @@ inline void gcode_G92() {
|
|
|
|
* M1: Conditional stop - Wait for user button press on LCD
|
|
|
|
* M1: Conditional stop - Wait for user button press on LCD
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
inline void gcode_M0_M1() {
|
|
|
|
inline void gcode_M0_M1() {
|
|
|
|
char* args = current_command_args;
|
|
|
|
const char * const args = current_command_args;
|
|
|
|
|
|
|
|
|
|
|
|
millis_t codenum = 0;
|
|
|
|
millis_t codenum = 0;
|
|
|
|
bool hasP = false, hasS = false;
|
|
|
|
bool hasP = false, hasS = false;
|
|
|
@ -5524,7 +5534,7 @@ inline void gcode_G92() {
|
|
|
|
KEEPALIVE_STATE(IN_HANDLER);
|
|
|
|
KEEPALIVE_STATE(IN_HANDLER);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif // EMERGENCY_PARSER || ULTIPANEL
|
|
|
|
#endif // HAS_RESUME_CONTINUE
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* M17: Enable power on all stepper motors
|
|
|
|
* M17: Enable power on all stepper motors
|
|
|
@ -5806,70 +5816,94 @@ inline void gcode_M42() {
|
|
|
|
#include "pinsDebug.h"
|
|
|
|
#include "pinsDebug.h"
|
|
|
|
|
|
|
|
|
|
|
|
inline void toggle_pins() {
|
|
|
|
inline void toggle_pins() {
|
|
|
|
int pin, j;
|
|
|
|
const bool I_flag = code_seen('I') && code_value_bool();
|
|
|
|
|
|
|
|
const int repeat = code_seen('R') ? code_value_int() : 1,
|
|
|
|
bool I_flag = code_seen('I') ? code_value_bool() : false;
|
|
|
|
start = code_seen('S') ? code_value_int() : 0,
|
|
|
|
|
|
|
|
end = code_seen('E') ? code_value_int() : NUM_DIGITAL_PINS - 1,
|
|
|
|
int repeat = code_seen('R') ? code_value_int() : 1,
|
|
|
|
wait = code_seen('W') ? code_value_int() : 500;
|
|
|
|
start = code_seen('S') ? code_value_int() : 0,
|
|
|
|
|
|
|
|
end = code_seen('E') ? code_value_int() : NUM_DIGITAL_PINS - 1,
|
|
|
|
|
|
|
|
wait = code_seen('W') ? code_value_int() : 500;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (pin = start; pin <= end; pin++) {
|
|
|
|
for (uint8_t pin = start; pin <= end; pin++) {
|
|
|
|
if (!I_flag && pin_is_protected(pin)) {
|
|
|
|
if (!I_flag && pin_is_protected(pin)) {
|
|
|
|
SERIAL_ECHOPAIR("Sensitive Pin: ", pin);
|
|
|
|
SERIAL_ECHOPAIR("Sensitive Pin: ", pin);
|
|
|
|
SERIAL_ECHOPGM(" untouched.\n");
|
|
|
|
SERIAL_ECHOLNPGM(" untouched.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
SERIAL_ECHOPAIR("Pulsing Pin: ", pin);
|
|
|
|
SERIAL_ECHOPAIR("Pulsing Pin: ", pin);
|
|
|
|
pinMode(pin, OUTPUT);
|
|
|
|
pinMode(pin, OUTPUT);
|
|
|
|
for(j = 0; j < repeat; j++) {
|
|
|
|
for (int16_t j = 0; j < repeat; j++) {
|
|
|
|
digitalWrite(pin, 0);
|
|
|
|
digitalWrite(pin, 0);
|
|
|
|
safe_delay(wait);
|
|
|
|
safe_delay(wait);
|
|
|
|
digitalWrite(pin, 1);
|
|
|
|
digitalWrite(pin, 1);
|
|
|
|
safe_delay(wait);
|
|
|
|
safe_delay(wait);
|
|
|
|
digitalWrite(pin, 0);
|
|
|
|
digitalWrite(pin, 0);
|
|
|
|
safe_delay(wait);
|
|
|
|
safe_delay(wait);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
SERIAL_ECHOPGM("\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
SERIAL_CHAR('\n');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
SERIAL_ECHOPGM("Done\n");
|
|
|
|
SERIAL_ECHOLNPGM("Done.");
|
|
|
|
|
|
|
|
|
|
|
|
} // toggle_pins
|
|
|
|
} // toggle_pins
|
|
|
|
|
|
|
|
|
|
|
|
inline void servo_probe_test(){
|
|
|
|
inline void servo_probe_test() {
|
|
|
|
#if !(NUM_SERVOS >= 1 && HAS_SERVO_0)
|
|
|
|
#if !(NUM_SERVOS > 0 && HAS_SERVO_0)
|
|
|
|
|
|
|
|
|
|
|
|
SERIAL_ERROR_START;
|
|
|
|
SERIAL_ERROR_START;
|
|
|
|
SERIAL_ERRORLNPGM("SERVO not setup");
|
|
|
|
SERIAL_ERRORLNPGM("SERVO not setup");
|
|
|
|
|
|
|
|
|
|
|
|
#elif !HAS_Z_SERVO_ENDSTOP
|
|
|
|
#elif !HAS_Z_SERVO_ENDSTOP
|
|
|
|
|
|
|
|
|
|
|
|
SERIAL_ERROR_START;
|
|
|
|
SERIAL_ERROR_START;
|
|
|
|
SERIAL_ERRORLNPGM("Z_ENDSTOP_SERVO_NR not setup");
|
|
|
|
SERIAL_ERRORLNPGM("Z_ENDSTOP_SERVO_NR not setup");
|
|
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
uint8_t probe_index = code_seen('P') ? code_value_byte() : Z_ENDSTOP_SERVO_NR;
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(z_servo_angle)
|
|
|
|
|
|
|
|
const int z_servo_angle[2] = Z_SERVO_ANGLES;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const uint8_t probe_index = code_seen('P') ? code_value_byte() : Z_ENDSTOP_SERVO_NR;
|
|
|
|
|
|
|
|
|
|
|
|
SERIAL_PROTOCOLLNPGM("Servo probe test");
|
|
|
|
SERIAL_PROTOCOLLNPGM("Servo probe test");
|
|
|
|
SERIAL_PROTOCOLLNPAIR(". using index: ", probe_index);
|
|
|
|
SERIAL_PROTOCOLLNPAIR(". using index: ", probe_index);
|
|
|
|
SERIAL_PROTOCOLLNPAIR(". deploy angle: ", z_servo_angle[0]);
|
|
|
|
SERIAL_PROTOCOLLNPAIR(". deploy angle: ", z_servo_angle[0]);
|
|
|
|
SERIAL_PROTOCOLLNPAIR(". stow angle: ", z_servo_angle[1]);
|
|
|
|
SERIAL_PROTOCOLLNPAIR(". stow angle: ", z_servo_angle[1]);
|
|
|
|
|
|
|
|
|
|
|
|
bool probe_inverting;
|
|
|
|
bool probe_inverting;
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
|
|
|
|
#if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
|
|
|
|
|
|
|
|
|
|
|
|
#define PROBE_TEST_PIN Z_MIN_PIN
|
|
|
|
#define PROBE_TEST_PIN Z_MIN_PIN
|
|
|
|
|
|
|
|
|
|
|
|
SERIAL_PROTOCOLLNPAIR(". probe uses Z_MIN pin: ", PROBE_TEST_PIN);
|
|
|
|
SERIAL_PROTOCOLLNPAIR(". probe uses Z_MIN pin: ", PROBE_TEST_PIN);
|
|
|
|
SERIAL_PROTOCOLLNPGM(". uses Z_MIN_ENDSTOP_INVERTING (ignores Z_MIN_PROBE_ENDSTOP_INVERTING)");
|
|
|
|
SERIAL_PROTOCOLLNPGM(". uses Z_MIN_ENDSTOP_INVERTING (ignores Z_MIN_PROBE_ENDSTOP_INVERTING)");
|
|
|
|
SERIAL_PROTOCOLPGM(". Z_MIN_ENDSTOP_INVERTING: ");
|
|
|
|
SERIAL_PROTOCOLPGM(". Z_MIN_ENDSTOP_INVERTING: ");
|
|
|
|
if (Z_MIN_ENDSTOP_INVERTING) SERIAL_PROTOCOLLNPGM("true");
|
|
|
|
|
|
|
|
else SERIAL_PROTOCOLLNPGM("false");
|
|
|
|
#if Z_MIN_ENDSTOP_INVERTING
|
|
|
|
|
|
|
|
SERIAL_PROTOCOLLNPGM("true");
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
SERIAL_PROTOCOLLNPGM("false");
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
probe_inverting = Z_MIN_ENDSTOP_INVERTING;
|
|
|
|
probe_inverting = Z_MIN_ENDSTOP_INVERTING;
|
|
|
|
|
|
|
|
|
|
|
|
#elif ENABLED(Z_MIN_PROBE_ENDSTOP)
|
|
|
|
#elif ENABLED(Z_MIN_PROBE_ENDSTOP)
|
|
|
|
|
|
|
|
|
|
|
|
#define PROBE_TEST_PIN Z_MIN_PROBE_PIN
|
|
|
|
#define PROBE_TEST_PIN Z_MIN_PROBE_PIN
|
|
|
|
SERIAL_PROTOCOLLNPAIR(". probe uses Z_MIN_PROBE_PIN: ", PROBE_TEST_PIN);
|
|
|
|
SERIAL_PROTOCOLLNPAIR(". probe uses Z_MIN_PROBE_PIN: ", PROBE_TEST_PIN);
|
|
|
|
SERIAL_PROTOCOLLNPGM(". uses Z_MIN_PROBE_ENDSTOP_INVERTING (ignores Z_MIN_ENDSTOP_INVERTING)");
|
|
|
|
SERIAL_PROTOCOLLNPGM(". uses Z_MIN_PROBE_ENDSTOP_INVERTING (ignores Z_MIN_ENDSTOP_INVERTING)");
|
|
|
|
SERIAL_PROTOCOLPGM(". Z_MIN_PROBE_ENDSTOP_INVERTING: ");
|
|
|
|
SERIAL_PROTOCOLPGM(". Z_MIN_PROBE_ENDSTOP_INVERTING: ");
|
|
|
|
if (Z_MIN_PROBE_ENDSTOP_INVERTING) SERIAL_PROTOCOLLNPGM("true");
|
|
|
|
|
|
|
|
else SERIAL_PROTOCOLLNPGM("false");
|
|
|
|
#if Z_MIN_PROBE_ENDSTOP_INVERTING
|
|
|
|
|
|
|
|
SERIAL_PROTOCOLLNPGM("true");
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
SERIAL_PROTOCOLLNPGM("false");
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
probe_inverting = Z_MIN_PROBE_ENDSTOP_INVERTING;
|
|
|
|
probe_inverting = Z_MIN_PROBE_ENDSTOP_INVERTING;
|
|
|
|
#else
|
|
|
|
|
|
|
|
#error "ERROR - probe pin not defined - strange, SANITY_CHECK should have caught this"
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
SERIAL_PROTOCOLLNPGM(". deploy & stow 4 times");
|
|
|
|
SERIAL_PROTOCOLLNPGM(". deploy & stow 4 times");
|
|
|
|
pinMode(PROBE_TEST_PIN, INPUT_PULLUP);
|
|
|
|
pinMode(PROBE_TEST_PIN, INPUT_PULLUP);
|
|
|
|
bool deploy_state;
|
|
|
|
bool deploy_state;
|
|
|
@ -5883,7 +5917,9 @@ inline void gcode_M42() {
|
|
|
|
stow_state = digitalRead(PROBE_TEST_PIN);
|
|
|
|
stow_state = digitalRead(PROBE_TEST_PIN);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (probe_inverting != deploy_state) SERIAL_PROTOCOLLNPGM("WARNING - INVERTING setting probably backwards");
|
|
|
|
if (probe_inverting != deploy_state) SERIAL_PROTOCOLLNPGM("WARNING - INVERTING setting probably backwards");
|
|
|
|
|
|
|
|
|
|
|
|
refresh_cmd_timeout();
|
|
|
|
refresh_cmd_timeout();
|
|
|
|
|
|
|
|
|
|
|
|
if (deploy_state != stow_state) {
|
|
|
|
if (deploy_state != stow_state) {
|
|
|
|
SERIAL_PROTOCOLLNPGM("BLTouch clone detected");
|
|
|
|
SERIAL_PROTOCOLLNPGM("BLTouch clone detected");
|
|
|
|
if (deploy_state) {
|
|
|
|
if (deploy_state) {
|
|
|
@ -5900,32 +5936,43 @@ inline void gcode_M42() {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else { // measure active signal length
|
|
|
|
else { // measure active signal length
|
|
|
|
servo[probe_index].move(z_servo_angle[0]); //deploy
|
|
|
|
servo[probe_index].move(z_servo_angle[0]); // deploy
|
|
|
|
safe_delay(500);
|
|
|
|
safe_delay(500);
|
|
|
|
SERIAL_PROTOCOLLNPGM("please trigger probe");
|
|
|
|
SERIAL_PROTOCOLLNPGM("please trigger probe");
|
|
|
|
uint16_t probe_counter = 0;
|
|
|
|
uint16_t probe_counter = 0;
|
|
|
|
for (uint16_t j = 0; j < 500*30 && probe_counter == 0 ; j++) { // allow 30 seconds max for operator to trigger probe
|
|
|
|
|
|
|
|
|
|
|
|
// Allow 30 seconds max for operator to trigger probe
|
|
|
|
|
|
|
|
for (uint16_t j = 0; j < 500 * 30 && probe_counter == 0 ; j++) {
|
|
|
|
|
|
|
|
|
|
|
|
safe_delay(2);
|
|
|
|
safe_delay(2);
|
|
|
|
if ( 0 == j%(500*1)) {refresh_cmd_timeout(); watchdog_reset();} // beat the dog every 45 seconds
|
|
|
|
|
|
|
|
if (deploy_state != digitalRead(PROBE_TEST_PIN)) { // probe triggered
|
|
|
|
if (0 == j % (500 * 1)) // keep cmd_timeout happy
|
|
|
|
for (probe_counter = 1; probe_counter < 50 && (deploy_state != digitalRead(PROBE_TEST_PIN)); probe_counter ++) {
|
|
|
|
refresh_cmd_timeout();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (deploy_state != digitalRead(PROBE_TEST_PIN)) { // probe triggered
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (probe_counter = 1; probe_counter < 50 && deploy_state != digitalRead(PROBE_TEST_PIN); ++probe_counter)
|
|
|
|
safe_delay(2);
|
|
|
|
safe_delay(2);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (probe_counter == 50) {
|
|
|
|
if (probe_counter == 50)
|
|
|
|
SERIAL_PROTOCOLLNPGM("Z Servo Probe detected"); // >= 100mS active time
|
|
|
|
SERIAL_PROTOCOLLNPGM("Z Servo Probe detected"); // >= 100mS active time
|
|
|
|
}
|
|
|
|
else if (probe_counter >= 2)
|
|
|
|
else if (probe_counter >= 2 ) {
|
|
|
|
SERIAL_PROTOCOLLNPAIR("BLTouch compatible probe detected - pulse width (+/- 4mS): ", probe_counter * 2); // allow 4 - 100mS pulse
|
|
|
|
SERIAL_PROTOCOLLNPAIR("BLTouch compatible probe detected - pulse width (+/- 4mS): ", probe_counter * 2 ); // allow 4 - 100mS pulse
|
|
|
|
else
|
|
|
|
}
|
|
|
|
SERIAL_PROTOCOLLNPGM("noise detected - please re-run test"); // less than 2mS pulse
|
|
|
|
else {
|
|
|
|
|
|
|
|
SERIAL_PROTOCOLLNPGM("noise detected - please re-run test"); // less than 2mS pulse
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
servo[probe_index].move(z_servo_angle[1]); //stow
|
|
|
|
servo[probe_index].move(z_servo_angle[1]); //stow
|
|
|
|
|
|
|
|
|
|
|
|
} // pulse detected
|
|
|
|
} // pulse detected
|
|
|
|
} // for loop waiting for trigger
|
|
|
|
|
|
|
|
|
|
|
|
} // for loop waiting for trigger
|
|
|
|
|
|
|
|
|
|
|
|
if (probe_counter == 0) SERIAL_PROTOCOLLNPGM("trigger not detected");
|
|
|
|
if (probe_counter == 0) SERIAL_PROTOCOLLNPGM("trigger not detected");
|
|
|
|
} // measure active signal length
|
|
|
|
|
|
|
|
|
|
|
|
} // measure active signal length
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
} // servo_probe_test
|
|
|
|
} // servo_probe_test
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -5977,39 +6024,43 @@ inline void gcode_M42() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Get the range of pins to test or watch
|
|
|
|
// Get the range of pins to test or watch
|
|
|
|
int first_pin = 0, last_pin = NUM_DIGITAL_PINS - 1;
|
|
|
|
const uint8_t first_pin = code_seen('P') ? code_value_byte() : 0,
|
|
|
|
if (code_seen('P')) {
|
|
|
|
last_pin = code_seen('P') ? first_pin : NUM_DIGITAL_PINS - 1;
|
|
|
|
first_pin = last_pin = code_value_byte();
|
|
|
|
|
|
|
|
if (first_pin > NUM_DIGITAL_PINS - 1) return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool ignore_protection = code_seen('I') ? code_value_bool() : false;
|
|
|
|
if (first_pin > last_pin) return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const bool ignore_protection = code_seen('I') && code_value_bool();
|
|
|
|
|
|
|
|
|
|
|
|
// Watch until click, M108, or reset
|
|
|
|
// Watch until click, M108, or reset
|
|
|
|
if (code_seen('W') && code_value_bool()) { // watch digital pins
|
|
|
|
if (code_seen('W') && code_value_bool()) {
|
|
|
|
SERIAL_PROTOCOLLNPGM("Watching pins");
|
|
|
|
SERIAL_PROTOCOLLNPGM("Watching pins");
|
|
|
|
byte pin_state[last_pin - first_pin + 1];
|
|
|
|
byte pin_state[last_pin - first_pin + 1];
|
|
|
|
for (int8_t pin = first_pin; pin <= last_pin; pin++) {
|
|
|
|
for (int8_t pin = first_pin; pin <= last_pin; pin++) {
|
|
|
|
if (pin_is_protected(pin) && !ignore_protection) continue;
|
|
|
|
if (pin_is_protected(pin) && !ignore_protection) continue;
|
|
|
|
pinMode(pin, INPUT_PULLUP);
|
|
|
|
pinMode(pin, INPUT_PULLUP);
|
|
|
|
// if (IS_ANALOG(pin))
|
|
|
|
/*
|
|
|
|
// pin_state[pin - first_pin] = analogRead(pin - analogInputToDigitalPin(0)); // int16_t pin_state[...]
|
|
|
|
if (IS_ANALOG(pin))
|
|
|
|
// else
|
|
|
|
pin_state[pin - first_pin] = analogRead(pin - analogInputToDigitalPin(0)); // int16_t pin_state[...]
|
|
|
|
pin_state[pin - first_pin] = digitalRead(pin);
|
|
|
|
else
|
|
|
|
|
|
|
|
//*/
|
|
|
|
|
|
|
|
pin_state[pin - first_pin] = digitalRead(pin);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_RESUME_CONTINUE
|
|
|
|
#if HAS_RESUME_CONTINUE
|
|
|
|
wait_for_user = true;
|
|
|
|
wait_for_user = true;
|
|
|
|
|
|
|
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
for(;;) {
|
|
|
|
for (;;) {
|
|
|
|
for (int8_t pin = first_pin; pin <= last_pin; pin++) {
|
|
|
|
for (int8_t pin = first_pin; pin <= last_pin; pin++) {
|
|
|
|
if (pin_is_protected(pin)) continue;
|
|
|
|
if (pin_is_protected(pin)) continue;
|
|
|
|
byte val;
|
|
|
|
const byte val =
|
|
|
|
// if (IS_ANALOG(pin))
|
|
|
|
/*
|
|
|
|
// val = analogRead(pin - analogInputToDigitalPin(0)); // int16_t val
|
|
|
|
IS_ANALOG(pin)
|
|
|
|
// else
|
|
|
|
? analogRead(pin - analogInputToDigitalPin(0)) : // int16_t val
|
|
|
|
val = digitalRead(pin);
|
|
|
|
:
|
|
|
|
|
|
|
|
//*/
|
|
|
|
|
|
|
|
digitalRead(pin);
|
|
|
|
if (val != pin_state[pin - first_pin]) {
|
|
|
|
if (val != pin_state[pin - first_pin]) {
|
|
|
|
report_pin_state(pin);
|
|
|
|
report_pin_state(pin);
|
|
|
|
pin_state[pin - first_pin] = val;
|
|
|
|
pin_state[pin - first_pin] = val;
|
|
|
@ -6017,7 +6068,10 @@ inline void gcode_M42() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_RESUME_CONTINUE
|
|
|
|
#if HAS_RESUME_CONTINUE
|
|
|
|
if (!wait_for_user) break;
|
|
|
|
if (!wait_for_user) {
|
|
|
|
|
|
|
|
KEEPALIVE_STATE(IN_HANDLER);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
safe_delay(500);
|
|
|
|
safe_delay(500);
|
|
|
@ -9572,7 +9626,7 @@ void process_next_command() {
|
|
|
|
SERIAL_ECHOLN(current_command);
|
|
|
|
SERIAL_ECHOLN(current_command);
|
|
|
|
#if ENABLED(M100_FREE_MEMORY_WATCHER)
|
|
|
|
#if ENABLED(M100_FREE_MEMORY_WATCHER)
|
|
|
|
SERIAL_ECHOPAIR("slot:", cmd_queue_index_r);
|
|
|
|
SERIAL_ECHOPAIR("slot:", cmd_queue_index_r);
|
|
|
|
M100_dump_routine( " Command Queue:", &command_queue[0][0], &command_queue[BUFSIZE][MAX_CMD_SIZE] );
|
|
|
|
M100_dump_routine(" Command Queue:", &command_queue[0][0], &command_queue[BUFSIZE][MAX_CMD_SIZE]);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -11166,19 +11220,20 @@ void prepare_move_to_destination() {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void plan_arc(
|
|
|
|
void plan_arc(
|
|
|
|
float logical[XYZE], // Destination position
|
|
|
|
float logical[XYZE], // Destination position
|
|
|
|
float* offset, // Center of rotation relative to current_position
|
|
|
|
float *offset, // Center of rotation relative to current_position
|
|
|
|
uint8_t clockwise // Clockwise?
|
|
|
|
uint8_t clockwise // Clockwise?
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
|
|
|
|
|
|
|
|
float radius = HYPOT(offset[X_AXIS], offset[Y_AXIS]),
|
|
|
|
float r_X = -offset[X_AXIS], // Radius vector from center to current location
|
|
|
|
center_X = current_position[X_AXIS] + offset[X_AXIS],
|
|
|
|
r_Y = -offset[Y_AXIS];
|
|
|
|
center_Y = current_position[Y_AXIS] + offset[Y_AXIS],
|
|
|
|
|
|
|
|
linear_travel = logical[Z_AXIS] - current_position[Z_AXIS],
|
|
|
|
const float radius = HYPOT(r_X, r_Y),
|
|
|
|
extruder_travel = logical[E_AXIS] - current_position[E_AXIS],
|
|
|
|
center_X = current_position[X_AXIS] - r_X,
|
|
|
|
r_X = -offset[X_AXIS], // Radius vector from center to current location
|
|
|
|
center_Y = current_position[Y_AXIS] - r_Y,
|
|
|
|
r_Y = -offset[Y_AXIS],
|
|
|
|
rt_X = logical[X_AXIS] - center_X,
|
|
|
|
rt_X = logical[X_AXIS] - center_X,
|
|
|
|
rt_Y = logical[Y_AXIS] - center_Y,
|
|
|
|
rt_Y = logical[Y_AXIS] - center_Y;
|
|
|
|
linear_travel = logical[Z_AXIS] - current_position[Z_AXIS],
|
|
|
|
|
|
|
|
extruder_travel = logical[E_AXIS] - current_position[E_AXIS];
|
|
|
|
|
|
|
|
|
|
|
|
// CCW angle of rotation between position and target from the circle center. Only one atan2() trig computation required.
|
|
|
|
// CCW angle of rotation between position and target from the circle center. Only one atan2() trig computation required.
|
|
|
|
float angular_travel = atan2(r_X * rt_Y - r_Y * rt_X, r_X * rt_X + r_Y * rt_Y);
|
|
|
|
float angular_travel = atan2(r_X * rt_Y - r_Y * rt_X, r_X * rt_X + r_Y * rt_Y);
|
|
|
@ -11222,12 +11277,12 @@ void prepare_move_to_destination() {
|
|
|
|
* This is important when there are successive arc motions.
|
|
|
|
* This is important when there are successive arc motions.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
// Vector rotation matrix values
|
|
|
|
// Vector rotation matrix values
|
|
|
|
float arc_target[XYZE],
|
|
|
|
float arc_target[XYZE];
|
|
|
|
theta_per_segment = angular_travel / segments,
|
|
|
|
const float theta_per_segment = angular_travel / segments,
|
|
|
|
linear_per_segment = linear_travel / segments,
|
|
|
|
linear_per_segment = linear_travel / segments,
|
|
|
|
extruder_per_segment = extruder_travel / segments,
|
|
|
|
extruder_per_segment = extruder_travel / segments,
|
|
|
|
sin_T = theta_per_segment,
|
|
|
|
sin_T = theta_per_segment,
|
|
|
|
cos_T = 1 - 0.5 * sq(theta_per_segment); // Small angle approximation
|
|
|
|
cos_T = 1 - 0.5 * sq(theta_per_segment); // Small angle approximation
|
|
|
|
|
|
|
|
|
|
|
|
// Initialize the linear axis
|
|
|
|
// Initialize the linear axis
|
|
|
|
arc_target[Z_AXIS] = current_position[Z_AXIS];
|
|
|
|
arc_target[Z_AXIS] = current_position[Z_AXIS];
|
|
|
@ -11235,7 +11290,7 @@ void prepare_move_to_destination() {
|
|
|
|
// Initialize the extruder axis
|
|
|
|
// Initialize the extruder axis
|
|
|
|
arc_target[E_AXIS] = current_position[E_AXIS];
|
|
|
|
arc_target[E_AXIS] = current_position[E_AXIS];
|
|
|
|
|
|
|
|
|
|
|
|
float fr_mm_s = MMS_SCALED(feedrate_mm_s);
|
|
|
|
const float fr_mm_s = MMS_SCALED(feedrate_mm_s);
|
|
|
|
|
|
|
|
|
|
|
|
millis_t next_idle_ms = millis() + 200UL;
|
|
|
|
millis_t next_idle_ms = millis() + 200UL;
|
|
|
|
|
|
|
|
|
|
|
@ -11250,7 +11305,7 @@ void prepare_move_to_destination() {
|
|
|
|
|
|
|
|
|
|
|
|
if (++count < N_ARC_CORRECTION) {
|
|
|
|
if (++count < N_ARC_CORRECTION) {
|
|
|
|
// Apply vector rotation matrix to previous r_X / 1
|
|
|
|
// Apply vector rotation matrix to previous r_X / 1
|
|
|
|
float r_new_Y = r_X * sin_T + r_Y * cos_T;
|
|
|
|
const float r_new_Y = r_X * sin_T + r_Y * cos_T;
|
|
|
|
r_X = r_X * cos_T - r_Y * sin_T;
|
|
|
|
r_X = r_X * cos_T - r_Y * sin_T;
|
|
|
|
r_Y = r_new_Y;
|
|
|
|
r_Y = r_new_Y;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -11259,8 +11314,8 @@ void prepare_move_to_destination() {
|
|
|
|
// Compute exact location by applying transformation matrix from initial radius vector(=-offset).
|
|
|
|
// Compute exact location by applying transformation matrix from initial radius vector(=-offset).
|
|
|
|
// To reduce stuttering, the sin and cos could be computed at different times.
|
|
|
|
// To reduce stuttering, the sin and cos could be computed at different times.
|
|
|
|
// For now, compute both at the same time.
|
|
|
|
// For now, compute both at the same time.
|
|
|
|
float cos_Ti = cos(i * theta_per_segment),
|
|
|
|
const float cos_Ti = cos(i * theta_per_segment),
|
|
|
|
sin_Ti = sin(i * theta_per_segment);
|
|
|
|
sin_Ti = sin(i * theta_per_segment);
|
|
|
|
r_X = -offset[X_AXIS] * cos_Ti + offset[Y_AXIS] * sin_Ti;
|
|
|
|
r_X = -offset[X_AXIS] * cos_Ti + offset[Y_AXIS] * sin_Ti;
|
|
|
|
r_Y = -offset[X_AXIS] * sin_Ti - offset[Y_AXIS] * cos_Ti;
|
|
|
|
r_Y = -offset[X_AXIS] * sin_Ti - offset[Y_AXIS] * cos_Ti;
|
|
|
|
count = 0;
|
|
|
|
count = 0;
|
|
|
@ -11774,30 +11829,15 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
|
|
|
|
enable_E0();
|
|
|
|
enable_E0();
|
|
|
|
#else // !SWITCHING_EXTRUDER
|
|
|
|
#else // !SWITCHING_EXTRUDER
|
|
|
|
switch (active_extruder) {
|
|
|
|
switch (active_extruder) {
|
|
|
|
case 0:
|
|
|
|
case 0: oldstatus = E0_ENABLE_READ; enable_E0(); break;
|
|
|
|
oldstatus = E0_ENABLE_READ;
|
|
|
|
|
|
|
|
enable_E0();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
#if E_STEPPERS > 1
|
|
|
|
#if E_STEPPERS > 1
|
|
|
|
case 1:
|
|
|
|
case 1: oldstatus = E1_ENABLE_READ; enable_E1(); break;
|
|
|
|
oldstatus = E1_ENABLE_READ;
|
|
|
|
|
|
|
|
enable_E1();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
#if E_STEPPERS > 2
|
|
|
|
#if E_STEPPERS > 2
|
|
|
|
case 2:
|
|
|
|
case 2: oldstatus = E2_ENABLE_READ; enable_E2(); break;
|
|
|
|
oldstatus = E2_ENABLE_READ;
|
|
|
|
|
|
|
|
enable_E2();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
#if E_STEPPERS > 3
|
|
|
|
#if E_STEPPERS > 3
|
|
|
|
case 3:
|
|
|
|
case 3: oldstatus = E3_ENABLE_READ; enable_E3(); break;
|
|
|
|
oldstatus = E3_ENABLE_READ;
|
|
|
|
|
|
|
|
enable_E3();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
#if E_STEPPERS > 4
|
|
|
|
#if E_STEPPERS > 4
|
|
|
|
case 4:
|
|
|
|
case 4: oldstatus = E4_ENABLE_READ; enable_E4(); break;
|
|
|
|
oldstatus = E4_ENABLE_READ;
|
|
|
|
|
|
|
|
enable_E4();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
#endif // E_STEPPERS > 4
|
|
|
|
#endif // E_STEPPERS > 4
|
|
|
|
#endif // E_STEPPERS > 3
|
|
|
|
#endif // E_STEPPERS > 3
|
|
|
|
#endif // E_STEPPERS > 2
|
|
|
|
#endif // E_STEPPERS > 2
|
|
|
@ -11817,25 +11857,15 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
|
|
|
|
E0_ENABLE_WRITE(oldstatus);
|
|
|
|
E0_ENABLE_WRITE(oldstatus);
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
switch (active_extruder) {
|
|
|
|
switch (active_extruder) {
|
|
|
|
case 0:
|
|
|
|
case 0: E0_ENABLE_WRITE(oldstatus); break;
|
|
|
|
E0_ENABLE_WRITE(oldstatus);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
#if E_STEPPERS > 1
|
|
|
|
#if E_STEPPERS > 1
|
|
|
|
case 1:
|
|
|
|
case 1: E1_ENABLE_WRITE(oldstatus); break;
|
|
|
|
E1_ENABLE_WRITE(oldstatus);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
#if E_STEPPERS > 2
|
|
|
|
#if E_STEPPERS > 2
|
|
|
|
case 2:
|
|
|
|
case 2: E2_ENABLE_WRITE(oldstatus); break;
|
|
|
|
E2_ENABLE_WRITE(oldstatus);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
#if E_STEPPERS > 3
|
|
|
|
#if E_STEPPERS > 3
|
|
|
|
case 3:
|
|
|
|
case 3: E3_ENABLE_WRITE(oldstatus); break;
|
|
|
|
E3_ENABLE_WRITE(oldstatus);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
#if E_STEPPERS > 4
|
|
|
|
#if E_STEPPERS > 4
|
|
|
|
case 4:
|
|
|
|
case 4: E4_ENABLE_WRITE(oldstatus); break;
|
|
|
|
E4_ENABLE_WRITE(oldstatus);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
#endif // E_STEPPERS > 4
|
|
|
|
#endif // E_STEPPERS > 4
|
|
|
|
#endif // E_STEPPERS > 3
|
|
|
|
#endif // E_STEPPERS > 3
|
|
|
|
#endif // E_STEPPERS > 2
|
|
|
|
#endif // E_STEPPERS > 2
|
|
|
|