|
@@ -314,9 +314,9 @@ bool target_direction;
|
314
|
314
|
};
|
315
|
315
|
#endif
|
316
|
316
|
|
317
|
|
-#ifdef SERVO_ENDSTOPS
|
318
|
|
- const int servo_endstops[] = SERVO_ENDSTOPS;
|
319
|
|
- const int servo_endstop_angles[][2] = SERVO_ENDSTOP_ANGLES;
|
|
317
|
+#if HAS_SERVO_ENDSTOPS
|
|
318
|
+ const int servo_endstop_id[] = SERVO_ENDSTOP_IDS;
|
|
319
|
+ const int servo_endstop_angle[][2] = SERVO_ENDSTOP_ANGLES;
|
320
|
320
|
#endif
|
321
|
321
|
|
322
|
322
|
#ifdef BARICUDA
|
|
@@ -578,10 +578,10 @@ void servo_init() {
|
578
|
578
|
#endif
|
579
|
579
|
|
580
|
580
|
// Set position of Servo Endstops that are defined
|
581
|
|
- #ifdef SERVO_ENDSTOPS
|
|
581
|
+ #if HAS_SERVO_ENDSTOPS
|
582
|
582
|
for (int i = 0; i < 3; i++)
|
583
|
|
- if (servo_endstops[i] >= 0)
|
584
|
|
- servo[servo_endstops[i]].move(servo_endstop_angles[i][1]);
|
|
583
|
+ if (servo_endstop_id[i] >= 0)
|
|
584
|
+ servo[servo_endstop_id[i]].move(servo_endstop_angle[i][1]);
|
585
|
585
|
#endif
|
586
|
586
|
|
587
|
587
|
}
|
|
@@ -1322,10 +1322,10 @@ static void setup_for_endstop_move() {
|
1322
|
1322
|
|
1323
|
1323
|
static void deploy_z_probe() {
|
1324
|
1324
|
|
1325
|
|
- #ifdef SERVO_ENDSTOPS
|
|
1325
|
+ #if HAS_SERVO_ENDSTOPS
|
1326
|
1326
|
|
1327
|
1327
|
// Engage Z Servo endstop if enabled
|
1328
|
|
- if (servo_endstops[Z_AXIS] >= 0) servo[servo_endstops[Z_AXIS]].move(servo_endstop_angles[Z_AXIS][0]);
|
|
1328
|
+ if (servo_endstop_id[Z_AXIS] >= 0) servo[servo_endstop_id[Z_AXIS]].move(servo_endstop_angle[Z_AXIS][0]);
|
1329
|
1329
|
|
1330
|
1330
|
#elif defined(Z_PROBE_ALLEN_KEY)
|
1331
|
1331
|
feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE;
|
|
@@ -1412,10 +1412,10 @@ static void setup_for_endstop_move() {
|
1412
|
1412
|
|
1413
|
1413
|
static void stow_z_probe(bool doRaise=true) {
|
1414
|
1414
|
|
1415
|
|
- #ifdef SERVO_ENDSTOPS
|
|
1415
|
+ #if HAS_SERVO_ENDSTOPS
|
1416
|
1416
|
|
1417
|
1417
|
// Retract Z Servo endstop if enabled
|
1418
|
|
- if (servo_endstops[Z_AXIS] >= 0) {
|
|
1418
|
+ if (servo_endstop_id[Z_AXIS] >= 0) {
|
1419
|
1419
|
|
1420
|
1420
|
#if Z_RAISE_AFTER_PROBING > 0
|
1421
|
1421
|
if (doRaise) {
|
|
@@ -1425,7 +1425,7 @@ static void setup_for_endstop_move() {
|
1425
|
1425
|
#endif
|
1426
|
1426
|
|
1427
|
1427
|
// Change the Z servo angle
|
1428
|
|
- servo[servo_endstops[Z_AXIS]].move(servo_endstop_angles[Z_AXIS][1]);
|
|
1428
|
+ servo[servo_endstop_id[Z_AXIS]].move(servo_endstop_angle[Z_AXIS][1]);
|
1429
|
1429
|
}
|
1430
|
1430
|
|
1431
|
1431
|
#elif defined(Z_PROBE_ALLEN_KEY)
|
|
@@ -1676,10 +1676,10 @@ static void homeaxis(AxisEnum axis) {
|
1676
|
1676
|
|
1677
|
1677
|
#endif
|
1678
|
1678
|
|
1679
|
|
- #ifdef SERVO_ENDSTOPS
|
|
1679
|
+ #if HAS_SERVO_ENDSTOPS
|
1680
|
1680
|
// Engage Servo endstop if enabled
|
1681
|
|
- if (axis != Z_AXIS && servo_endstops[axis] >= 0)
|
1682
|
|
- servo[servo_endstops[axis]].move(servo_endstop_angles[axis][0]);
|
|
1681
|
+ if (axis != Z_AXIS && servo_endstop_id[axis] >= 0)
|
|
1682
|
+ servo[servo_endstop_id[axis]].move(servo_endstop_angle[axis][0]);
|
1683
|
1683
|
#endif
|
1684
|
1684
|
|
1685
|
1685
|
// Set a flag for Z motor locking
|
|
@@ -1778,10 +1778,10 @@ static void homeaxis(AxisEnum axis) {
|
1778
|
1778
|
#endif
|
1779
|
1779
|
|
1780
|
1780
|
{
|
1781
|
|
- #ifdef SERVO_ENDSTOPS
|
|
1781
|
+ #if HAS_SERVO_ENDSTOPS
|
1782
|
1782
|
// Retract Servo endstop if enabled
|
1783
|
|
- if (servo_endstops[axis] >= 0)
|
1784
|
|
- servo[servo_endstops[axis]].move(servo_endstop_angles[axis][1]);
|
|
1783
|
+ if (servo_endstop_id[axis] >= 0)
|
|
1784
|
+ servo[servo_endstop_id[axis]].move(servo_endstop_angle[axis][1]);
|
1785
|
1785
|
#endif
|
1786
|
1786
|
}
|
1787
|
1787
|
|
|
@@ -2778,7 +2778,7 @@ inline void gcode_G28() {
|
2778
|
2778
|
// added here, it could be seen as a compensating factor for the Z probe.
|
2779
|
2779
|
//
|
2780
|
2780
|
current_position[Z_AXIS] = -zprobe_zoffset + (z_tmp - real_z)
|
2781
|
|
- #if defined(SERVO_ENDSTOPS) || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED)
|
|
2781
|
+ #if HAS_SERVO_ENDSTOPS || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED)
|
2782
|
2782
|
+ Z_RAISE_AFTER_PROBING
|
2783
|
2783
|
#endif
|
2784
|
2784
|
;
|
|
@@ -4570,9 +4570,9 @@ inline void gcode_M303() {
|
4570
|
4570
|
*/
|
4571
|
4571
|
inline void gcode_M400() { st_synchronize(); }
|
4572
|
4572
|
|
4573
|
|
-#if defined(ENABLE_AUTO_BED_LEVELING) && !defined(Z_PROBE_SLED) && (defined(SERVO_ENDSTOPS) || defined(Z_PROBE_ALLEN_KEY))
|
|
4573
|
+#if defined(ENABLE_AUTO_BED_LEVELING) && !defined(Z_PROBE_SLED) && (HAS_SERVO_ENDSTOPS || defined(Z_PROBE_ALLEN_KEY))
|
4574
|
4574
|
|
4575
|
|
- #ifdef SERVO_ENDSTOPS
|
|
4575
|
+ #if HAS_SERVO_ENDSTOPS
|
4576
|
4576
|
void raise_z_for_servo() {
|
4577
|
4577
|
float zpos = current_position[Z_AXIS], z_dest = Z_RAISE_BEFORE_HOMING;
|
4578
|
4578
|
z_dest += axis_known_position[Z_AXIS] ? zprobe_zoffset : zpos;
|
|
@@ -4584,7 +4584,7 @@ inline void gcode_M400() { st_synchronize(); }
|
4584
|
4584
|
* M401: Engage Z Servo endstop if available
|
4585
|
4585
|
*/
|
4586
|
4586
|
inline void gcode_M401() {
|
4587
|
|
- #ifdef SERVO_ENDSTOPS
|
|
4587
|
+ #if HAS_SERVO_ENDSTOPS
|
4588
|
4588
|
raise_z_for_servo();
|
4589
|
4589
|
#endif
|
4590
|
4590
|
deploy_z_probe();
|
|
@@ -4594,13 +4594,13 @@ inline void gcode_M400() { st_synchronize(); }
|
4594
|
4594
|
* M402: Retract Z Servo endstop if enabled
|
4595
|
4595
|
*/
|
4596
|
4596
|
inline void gcode_M402() {
|
4597
|
|
- #ifdef SERVO_ENDSTOPS
|
|
4597
|
+ #if HAS_SERVO_ENDSTOPS
|
4598
|
4598
|
raise_z_for_servo();
|
4599
|
4599
|
#endif
|
4600
|
4600
|
stow_z_probe(false);
|
4601
|
4601
|
}
|
4602
|
4602
|
|
4603
|
|
-#endif // ENABLE_AUTO_BED_LEVELING && (SERVO_ENDSTOPS || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED
|
|
4603
|
+#endif // ENABLE_AUTO_BED_LEVELING && (HAS_SERVO_ENDSTOPS || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED
|
4604
|
4604
|
|
4605
|
4605
|
#ifdef FILAMENT_SENSOR
|
4606
|
4606
|
|
|
@@ -5645,14 +5645,14 @@ void process_next_command() {
|
5645
|
5645
|
gcode_M400();
|
5646
|
5646
|
break;
|
5647
|
5647
|
|
5648
|
|
- #if defined(ENABLE_AUTO_BED_LEVELING) && (defined(SERVO_ENDSTOPS) || defined(Z_PROBE_ALLEN_KEY)) && !defined(Z_PROBE_SLED)
|
|
5648
|
+ #if defined(ENABLE_AUTO_BED_LEVELING) && (HAS_SERVO_ENDSTOPS || defined(Z_PROBE_ALLEN_KEY)) && !defined(Z_PROBE_SLED)
|
5649
|
5649
|
case 401:
|
5650
|
5650
|
gcode_M401();
|
5651
|
5651
|
break;
|
5652
|
5652
|
case 402:
|
5653
|
5653
|
gcode_M402();
|
5654
|
5654
|
break;
|
5655
|
|
- #endif // ENABLE_AUTO_BED_LEVELING && (SERVO_ENDSTOPS || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED
|
|
5655
|
+ #endif // ENABLE_AUTO_BED_LEVELING && (HAS_SERVO_ENDSTOPS || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED
|
5656
|
5656
|
|
5657
|
5657
|
#ifdef FILAMENT_SENSOR
|
5658
|
5658
|
case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or display nominal filament width
|