Add custom types for position (#15204)

This commit is contained in:
Scott Lahteine
2019-09-29 04:25:39 -05:00
committed by GitHub
parent 43d6e9fa43
commit 50e4545255
227 changed files with 3147 additions and 3264 deletions

View File

@ -31,8 +31,8 @@
* M122: Debug TMC drivers
*/
void GcodeSuite::M122() {
bool print_axis[XYZE] = { false, false, false, false },
print_all = true;
xyze_bool_t print_axis = { false, false, false, false };
bool print_all = true;
LOOP_XYZE(i) if (parser.seen(axis_codes[i])) { print_axis[i] = true; print_all = false; }
if (print_all) LOOP_XYZE(i) print_axis[i] = true;
@ -45,12 +45,12 @@ void GcodeSuite::M122() {
#endif
if (parser.seen('V'))
tmc_get_registers(print_axis[X_AXIS], print_axis[Y_AXIS], print_axis[Z_AXIS], print_axis[E_AXIS]);
tmc_get_registers(print_axis.x, print_axis.y, print_axis.z, print_axis.e);
else
tmc_report_all(print_axis[X_AXIS], print_axis[Y_AXIS], print_axis[Z_AXIS], print_axis[E_AXIS]);
tmc_report_all(print_axis.x, print_axis.y, print_axis.z, print_axis.e);
#endif
test_tmc_connection(print_axis[X_AXIS], print_axis[Y_AXIS], print_axis[Z_AXIS], print_axis[E_AXIS]);
test_tmc_connection(print_axis.x, print_axis.y, print_axis.z, print_axis.e);
}
#endif // HAS_TRINAMIC

View File

@ -104,25 +104,25 @@
*/
void GcodeSuite::M912() {
#if M91x_SOME_X
const bool hasX = parser.seen(axis_codes[X_AXIS]);
const bool hasX = parser.seen(axis_codes.x);
#else
constexpr bool hasX = false;
#endif
#if M91x_SOME_Y
const bool hasY = parser.seen(axis_codes[Y_AXIS]);
const bool hasY = parser.seen(axis_codes.y);
#else
constexpr bool hasY = false;
#endif
#if M91x_SOME_Z
const bool hasZ = parser.seen(axis_codes[Z_AXIS]);
const bool hasZ = parser.seen(axis_codes.z);
#else
constexpr bool hasZ = false;
#endif
#if M91x_SOME_E
const bool hasE = parser.seen(axis_codes[E_AXIS]);
const bool hasE = parser.seen(axis_codes.e);
#else
constexpr bool hasE = false;
#endif
@ -130,7 +130,7 @@
const bool hasNone = !hasX && !hasY && !hasZ && !hasE;
#if M91x_SOME_X
const int8_t xval = int8_t(parser.byteval(axis_codes[X_AXIS], 0xFF));
const int8_t xval = int8_t(parser.byteval(axis_codes.x, 0xFF));
#if M91x_USE(X)
if (hasNone || xval == 1 || (hasX && xval < 0)) tmc_clear_otpw(stepperX);
#endif
@ -140,7 +140,7 @@
#endif
#if M91x_SOME_Y
const int8_t yval = int8_t(parser.byteval(axis_codes[Y_AXIS], 0xFF));
const int8_t yval = int8_t(parser.byteval(axis_codes.y, 0xFF));
#if M91x_USE(Y)
if (hasNone || yval == 1 || (hasY && yval < 0)) tmc_clear_otpw(stepperY);
#endif
@ -150,7 +150,7 @@
#endif
#if M91x_SOME_Z
const int8_t zval = int8_t(parser.byteval(axis_codes[Z_AXIS], 0xFF));
const int8_t zval = int8_t(parser.byteval(axis_codes.z, 0xFF));
#if M91x_USE(Z)
if (hasNone || zval == 1 || (hasZ && zval < 0)) tmc_clear_otpw(stepperZ);
#endif
@ -163,7 +163,7 @@
#endif
#if M91x_SOME_E
const int8_t eval = int8_t(parser.byteval(axis_codes[E_AXIS], 0xFF));
const int8_t eval = int8_t(parser.byteval(axis_codes.e, 0xFF));
#if M91x_USE_E(0)
if (hasNone || eval == 0 || (hasE && eval < 0)) tmc_clear_otpw(stepperE0);
#endif