@ -46,13 +46,16 @@ inline stepper_flags_t selected_axis_bits() {
|
||||
selected.bits = selected.e_bits();
|
||||
}
|
||||
#endif
|
||||
selected.bits |= LINEAR_AXIS_GANG(
|
||||
selected.bits |= NUM_AXIS_GANG(
|
||||
(parser.seen_test('X') << X_AXIS),
|
||||
| (parser.seen_test('Y') << Y_AXIS),
|
||||
| (parser.seen_test('Z') << Z_AXIS),
|
||||
| (parser.seen_test(AXIS4_NAME) << I_AXIS),
|
||||
| (parser.seen_test(AXIS5_NAME) << J_AXIS),
|
||||
| (parser.seen_test(AXIS6_NAME) << K_AXIS)
|
||||
| (parser.seen_test(AXIS6_NAME) << K_AXIS),
|
||||
| (parser.seen_test(AXIS7_NAME) << U_AXIS),
|
||||
| (parser.seen_test(AXIS8_NAME) << V_AXIS),
|
||||
| (parser.seen_test(AXIS9_NAME) << W_AXIS)
|
||||
);
|
||||
return selected;
|
||||
}
|
||||
@ -69,7 +72,7 @@ void do_enable(const stepper_flags_t to_enable) {
|
||||
ena_mask_t also_enabled = 0; // Track steppers enabled due to overlap
|
||||
|
||||
// Enable all flagged axes
|
||||
LOOP_LINEAR_AXES(a) {
|
||||
LOOP_NUM_AXES(a) {
|
||||
if (TEST(shall_enable, a)) {
|
||||
stepper.enable_axis(AxisEnum(a)); // Mark and enable the requested axis
|
||||
DEBUG_ECHOLNPGM("Enabled ", axis_codes[a], " (", a, ") with overlap ", hex_word(enable_overlap[a]), " ... Enabled: ", hex_word(stepper.axis_enabled.bits));
|
||||
@ -89,7 +92,7 @@ void do_enable(const stepper_flags_t to_enable) {
|
||||
|
||||
if ((also_enabled &= ~(shall_enable | was_enabled))) {
|
||||
SERIAL_CHAR('(');
|
||||
LOOP_LINEAR_AXES(a) if (TEST(also_enabled, a)) SERIAL_CHAR(axis_codes[a], ' ');
|
||||
LOOP_NUM_AXES(a) if (TEST(also_enabled, a)) SERIAL_CHAR(AXIS_CHAR(a), ' ');
|
||||
#if HAS_EXTRUDERS
|
||||
#define _EN_ALSO(N) if (TEST(also_enabled, INDEX_OF_AXIS(E_AXIS, N))) SERIAL_CHAR('E', '0' + N, ' ');
|
||||
REPEAT(EXTRUDERS, _EN_ALSO)
|
||||
@ -125,13 +128,16 @@ void GcodeSuite::M17() {
|
||||
stepper.enable_e_steppers();
|
||||
}
|
||||
#endif
|
||||
LINEAR_AXIS_CODE(
|
||||
NUM_AXIS_CODE(
|
||||
if (parser.seen_test('X')) stepper.enable_axis(X_AXIS),
|
||||
if (parser.seen_test('Y')) stepper.enable_axis(Y_AXIS),
|
||||
if (parser.seen_test('Z')) stepper.enable_axis(Z_AXIS),
|
||||
if (parser.seen_test(AXIS4_NAME)) stepper.enable_axis(I_AXIS),
|
||||
if (parser.seen_test(AXIS5_NAME)) stepper.enable_axis(J_AXIS),
|
||||
if (parser.seen_test(AXIS6_NAME)) stepper.enable_axis(K_AXIS)
|
||||
if (parser.seen_test(AXIS6_NAME)) stepper.enable_axis(K_AXIS),
|
||||
if (parser.seen_test(AXIS7_NAME)) stepper.enable_axis(U_AXIS),
|
||||
if (parser.seen_test(AXIS8_NAME)) stepper.enable_axis(V_AXIS),
|
||||
if (parser.seen_test(AXIS9_NAME)) stepper.enable_axis(W_AXIS)
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -149,7 +155,7 @@ void try_to_disable(const stepper_flags_t to_disable) {
|
||||
if (!still_enabled) return;
|
||||
|
||||
// Attempt to disable all flagged axes
|
||||
LOOP_LINEAR_AXES(a)
|
||||
LOOP_NUM_AXES(a)
|
||||
if (TEST(to_disable.bits, a)) {
|
||||
DEBUG_ECHOPGM("Try to disable ", axis_codes[a], " (", a, ") with overlap ", hex_word(enable_overlap[a]), " ... ");
|
||||
if (stepper.disable_axis(AxisEnum(a))) { // Mark the requested axis and request to disable
|
||||
@ -178,7 +184,7 @@ void try_to_disable(const stepper_flags_t to_disable) {
|
||||
|
||||
auto overlap_warning = [](const ena_mask_t axis_bits) {
|
||||
SERIAL_ECHOPGM(" not disabled. Shared with");
|
||||
LOOP_LINEAR_AXES(a) if (TEST(axis_bits, a)) SERIAL_CHAR(' ', axis_codes[a]);
|
||||
LOOP_NUM_AXES(a) if (TEST(axis_bits, a)) SERIAL_CHAR(' ', axis_codes[a]);
|
||||
#if HAS_EXTRUDERS
|
||||
#define _EN_STILLON(N) if (TEST(axis_bits, INDEX_OF_AXIS(E_AXIS, N))) SERIAL_CHAR(' ', 'E', '0' + N);
|
||||
REPEAT(EXTRUDERS, _EN_STILLON)
|
||||
@ -187,7 +193,7 @@ void try_to_disable(const stepper_flags_t to_disable) {
|
||||
};
|
||||
|
||||
// If any of the requested axes are still enabled, give a warning
|
||||
LOOP_LINEAR_AXES(a) {
|
||||
LOOP_NUM_AXES(a) {
|
||||
if (TEST(still_enabled, a)) {
|
||||
SERIAL_CHAR(axis_codes[a]);
|
||||
overlap_warning(stepper.axis_enabled.bits & enable_overlap[a]);
|
||||
@ -238,13 +244,16 @@ void GcodeSuite::M18_M84() {
|
||||
stepper.disable_e_steppers();
|
||||
}
|
||||
#endif
|
||||
LINEAR_AXIS_CODE(
|
||||
NUM_AXIS_CODE(
|
||||
if (parser.seen_test('X')) stepper.disable_axis(X_AXIS),
|
||||
if (parser.seen_test('Y')) stepper.disable_axis(Y_AXIS),
|
||||
if (parser.seen_test('Z')) stepper.disable_axis(Z_AXIS),
|
||||
if (parser.seen_test(AXIS4_NAME)) stepper.disable_axis(I_AXIS),
|
||||
if (parser.seen_test(AXIS5_NAME)) stepper.disable_axis(J_AXIS),
|
||||
if (parser.seen_test(AXIS6_NAME)) stepper.disable_axis(K_AXIS)
|
||||
if (parser.seen_test(AXIS6_NAME)) stepper.disable_axis(K_AXIS),
|
||||
if (parser.seen_test(AXIS7_NAME)) stepper.disable_axis(U_AXIS),
|
||||
if (parser.seen_test(AXIS8_NAME)) stepper.disable_axis(V_AXIS),
|
||||
if (parser.seen_test(AXIS9_NAME)) stepper.disable_axis(W_AXIS)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -146,7 +146,7 @@
|
||||
|
||||
HOTEND_LOOP() {
|
||||
DEBUG_ECHOPGM_P(SP_T_STR, e);
|
||||
LOOP_LINEAR_AXES(a) DEBUG_ECHOPGM(" hotend_offset[", e, "].", AS_CHAR(AXIS_CHAR(a) | 0x20), "=", hotend_offset[e][a]);
|
||||
LOOP_NUM_AXES(a) DEBUG_ECHOPGM(" hotend_offset[", e, "].", AS_CHAR(AXIS_CHAR(a) | 0x20), "=", hotend_offset[e][a]);
|
||||
DEBUG_EOL();
|
||||
}
|
||||
DEBUG_EOL();
|
||||
|
Reference in New Issue
Block a user