|
@@ -1332,7 +1332,7 @@ static void setup_for_endstop_move() {
|
1332
|
1332
|
st_synchronize();
|
1333
|
1333
|
|
1334
|
1334
|
// Tell the planner where we ended up - Get this from the stepper handler
|
1335
|
|
- zPosition = st_get_position_mm(Z_AXIS);
|
|
1335
|
+ zPosition = st_get_axis_position_mm(Z_AXIS);
|
1336
|
1336
|
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS]);
|
1337
|
1337
|
|
1338
|
1338
|
// move up the retract distance
|
|
@@ -1350,7 +1350,7 @@ static void setup_for_endstop_move() {
|
1350
|
1350
|
endstops_hit_on_purpose(); // clear endstop hit flags
|
1351
|
1351
|
|
1352
|
1352
|
// Get the current stepper position after bumping an endstop
|
1353
|
|
- current_position[Z_AXIS] = st_get_position_mm(Z_AXIS);
|
|
1353
|
+ current_position[Z_AXIS] = st_get_axis_position_mm(Z_AXIS);
|
1354
|
1354
|
sync_plan_position();
|
1355
|
1355
|
|
1356
|
1356
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
|
@@ -3157,7 +3157,7 @@ inline void gcode_G28() {
|
3157
|
3157
|
float x_tmp = current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER,
|
3158
|
3158
|
y_tmp = current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER,
|
3159
|
3159
|
z_tmp = current_position[Z_AXIS],
|
3160
|
|
- real_z = st_get_position_mm(Z_AXIS); //get the real Z (since plan_get_position is now correcting the plane)
|
|
3160
|
+ real_z = st_get_axis_position_mm(Z_AXIS); //get the real Z (since plan_get_position is now correcting the plane)
|
3161
|
3161
|
|
3162
|
3162
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
3163
|
3163
|
if (marlin_debug_flags & DEBUG_LEVELING) {
|
|
@@ -3604,10 +3604,10 @@ inline void gcode_M42() {
|
3604
|
3604
|
}
|
3605
|
3605
|
}
|
3606
|
3606
|
|
3607
|
|
- double X_current = st_get_position_mm(X_AXIS),
|
3608
|
|
- Y_current = st_get_position_mm(Y_AXIS),
|
3609
|
|
- Z_current = st_get_position_mm(Z_AXIS),
|
3610
|
|
- E_current = st_get_position_mm(E_AXIS),
|
|
3607
|
+ double X_current = st_get_axis_position_mm(X_AXIS),
|
|
3608
|
+ Y_current = st_get_axis_position_mm(Y_AXIS),
|
|
3609
|
+ Z_current = st_get_axis_position_mm(Z_AXIS),
|
|
3610
|
+ E_current = st_get_axis_position_mm(E_AXIS),
|
3611
|
3611
|
X_probe_location = X_current, Y_probe_location = Y_current,
|
3612
|
3612
|
Z_start_location = Z_current + Z_RAISE_BEFORE_PROBING;
|
3613
|
3613
|
|
|
@@ -3661,10 +3661,10 @@ inline void gcode_M42() {
|
3661
|
3661
|
active_extruder);
|
3662
|
3662
|
st_synchronize();
|
3663
|
3663
|
|
3664
|
|
- current_position[X_AXIS] = X_current = st_get_position_mm(X_AXIS);
|
3665
|
|
- current_position[Y_AXIS] = Y_current = st_get_position_mm(Y_AXIS);
|
3666
|
|
- current_position[Z_AXIS] = Z_current = st_get_position_mm(Z_AXIS);
|
3667
|
|
- current_position[E_AXIS] = E_current = st_get_position_mm(E_AXIS);
|
|
3664
|
+ current_position[X_AXIS] = X_current = st_get_axis_position_mm(X_AXIS);
|
|
3665
|
+ current_position[Y_AXIS] = Y_current = st_get_axis_position_mm(Y_AXIS);
|
|
3666
|
+ current_position[Z_AXIS] = Z_current = st_get_axis_position_mm(Z_AXIS);
|
|
3667
|
+ current_position[E_AXIS] = E_current = st_get_axis_position_mm(E_AXIS);
|
3668
|
3668
|
|
3669
|
3669
|
//
|
3670
|
3670
|
// OK, do the initial probe to get us close to the bed.
|
|
@@ -3676,15 +3676,15 @@ inline void gcode_M42() {
|
3676
|
3676
|
setup_for_endstop_move();
|
3677
|
3677
|
run_z_probe();
|
3678
|
3678
|
|
3679
|
|
- current_position[Z_AXIS] = Z_current = st_get_position_mm(Z_AXIS);
|
3680
|
|
- Z_start_location = st_get_position_mm(Z_AXIS) + Z_RAISE_BEFORE_PROBING;
|
|
3679
|
+ Z_current = current_position[Z_AXIS] = st_get_axis_position_mm(Z_AXIS);
|
|
3680
|
+ Z_start_location = Z_current + Z_RAISE_BEFORE_PROBING;
|
3681
|
3681
|
|
3682
|
3682
|
plan_buffer_line(X_probe_location, Y_probe_location, Z_start_location,
|
3683
|
3683
|
E_current,
|
3684
|
3684
|
homing_feedrate[X_AXIS] / 60,
|
3685
|
3685
|
active_extruder);
|
3686
|
3686
|
st_synchronize();
|
3687
|
|
- current_position[Z_AXIS] = Z_current = st_get_position_mm(Z_AXIS);
|
|
3687
|
+ Z_current = current_position[Z_AXIS] = st_get_axis_position_mm(Z_AXIS);
|
3688
|
3688
|
|
3689
|
3689
|
if (deploy_probe_for_each_reading) stow_z_probe();
|
3690
|
3690
|
|
|
@@ -4302,12 +4302,33 @@ inline void gcode_M114() {
|
4302
|
4302
|
SERIAL_PROTOCOLPGM(" E:");
|
4303
|
4303
|
SERIAL_PROTOCOL(current_position[E_AXIS]);
|
4304
|
4304
|
|
4305
|
|
- SERIAL_PROTOCOLPGM(MSG_COUNT_X);
|
4306
|
|
- SERIAL_PROTOCOL(st_get_position_mm(X_AXIS));
|
4307
|
|
- SERIAL_PROTOCOLPGM(" Y:");
|
4308
|
|
- SERIAL_PROTOCOL(st_get_position_mm(Y_AXIS));
|
4309
|
|
- SERIAL_PROTOCOLPGM(" Z:");
|
4310
|
|
- SERIAL_PROTOCOL(st_get_position_mm(Z_AXIS));
|
|
4305
|
+ CRITICAL_SECTION_START;
|
|
4306
|
+ extern volatile long count_position[NUM_AXIS];
|
|
4307
|
+ long xpos = count_position[X_AXIS],
|
|
4308
|
+ ypos = count_position[Y_AXIS],
|
|
4309
|
+ zpos = count_position[Z_AXIS];
|
|
4310
|
+ CRITICAL_SECTION_END;
|
|
4311
|
+
|
|
4312
|
+ #if ENABLED(COREXY) || ENABLED(COREXZ)
|
|
4313
|
+ SERIAL_PROTOCOLPGM(MSG_COUNT_A);
|
|
4314
|
+ #else
|
|
4315
|
+ SERIAL_PROTOCOLPGM(MSG_COUNT_X);
|
|
4316
|
+ #endif
|
|
4317
|
+ SERIAL_PROTOCOL(xpos);
|
|
4318
|
+
|
|
4319
|
+ #if ENABLED(COREXY)
|
|
4320
|
+ SERIAL_PROTOCOLPGM(" B:");
|
|
4321
|
+ #else
|
|
4322
|
+ SERIAL_PROTOCOLPGM(" Y:");
|
|
4323
|
+ #endif
|
|
4324
|
+ SERIAL_PROTOCOL(ypos);
|
|
4325
|
+
|
|
4326
|
+ #if ENABLED(COREXZ)
|
|
4327
|
+ SERIAL_PROTOCOLPGM(" C:");
|
|
4328
|
+ #else
|
|
4329
|
+ SERIAL_PROTOCOLPGM(" Z:");
|
|
4330
|
+ #endif
|
|
4331
|
+ SERIAL_PROTOCOL(zpos);
|
4311
|
4332
|
|
4312
|
4333
|
SERIAL_EOL;
|
4313
|
4334
|
|