XYZ_CHAR macro
This commit is contained in:
@ -47,7 +47,7 @@ void GcodeSuite::M425() {
|
||||
bool noArgs = true;
|
||||
|
||||
LOOP_XYZ(a) {
|
||||
if (parser.seen(axis_codes[a])) {
|
||||
if (parser.seen(XYZ_CHAR(a))) {
|
||||
planner.synchronize();
|
||||
backlash.distance_mm[a] = parser.has_value() ? parser.value_linear_units() : backlash.get_measurement(AxisEnum(a));
|
||||
noArgs = false;
|
||||
@ -75,7 +75,7 @@ void GcodeSuite::M425() {
|
||||
SERIAL_ECHOLNPAIR(" Correction Amount/Fade-out: F", backlash.get_correction(), " (F1.0 = full, F0.0 = none)");
|
||||
SERIAL_ECHOPGM(" Backlash Distance (mm): ");
|
||||
LOOP_XYZ(a) {
|
||||
SERIAL_CHAR(' ', axis_codes[a]);
|
||||
SERIAL_CHAR(' ', XYZ_CHAR(a));
|
||||
SERIAL_ECHO(backlash.distance_mm[a]);
|
||||
SERIAL_EOL();
|
||||
}
|
||||
@ -88,7 +88,7 @@ void GcodeSuite::M425() {
|
||||
SERIAL_ECHOPGM(" Average measured backlash (mm):");
|
||||
if (backlash.has_any_measurement()) {
|
||||
LOOP_XYZ(a) if (backlash.has_measurement(AxisEnum(a))) {
|
||||
SERIAL_CHAR(' ', axis_codes[a]);
|
||||
SERIAL_CHAR(' ', XYZ_CHAR(a));
|
||||
SERIAL_ECHO(backlash.get_measurement(AxisEnum(a)));
|
||||
}
|
||||
}
|
||||
|
@ -40,10 +40,10 @@
|
||||
void GcodeSuite::M666() {
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM(">>> M666");
|
||||
LOOP_XYZ(i) {
|
||||
if (parser.seen(axis_codes[i])) {
|
||||
if (parser.seen(XYZ_CHAR(i))) {
|
||||
const float v = parser.value_linear_units();
|
||||
if (v * Z_HOME_DIR <= 0) delta_endstop_adj[i] = v;
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("delta_endstop_adj[", axis_codes[i], "] = ", delta_endstop_adj[i]);
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("delta_endstop_adj[", XYZ_CHAR(i), "] = ", delta_endstop_adj[i]);
|
||||
}
|
||||
}
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< M666");
|
||||
|
@ -138,7 +138,7 @@
|
||||
|
||||
HOTEND_LOOP() {
|
||||
DEBUG_ECHOPAIR_P(SP_T_STR, int(e));
|
||||
LOOP_XYZ(a) DEBUG_ECHOPAIR(" hotend_offset[", int(e), "].", axis_codes[a] | 0x20, "=", hotend_offset[e][a]);
|
||||
LOOP_XYZ(a) DEBUG_ECHOPAIR(" hotend_offset[", int(e), "].", XYZ_CHAR(a) | 0x20, "=", hotend_offset[e][a]);
|
||||
DEBUG_EOL();
|
||||
}
|
||||
DEBUG_EOL();
|
||||
|
@ -56,10 +56,10 @@ void GcodeSuite::G61(void) {
|
||||
|
||||
SERIAL_ECHOPAIR(STR_RESTORING_POS " S", int(slot));
|
||||
LOOP_XYZ(i) {
|
||||
destination[i] = parser.seen(axis_codes[i])
|
||||
destination[i] = parser.seen(XYZ_CHAR(i))
|
||||
? stored_position[slot][i] + parser.value_axis_units((AxisEnum)i)
|
||||
: current_position[i];
|
||||
SERIAL_CHAR(' ', axis_codes[i]);
|
||||
SERIAL_CHAR(' ', XYZ_CHAR(i));
|
||||
SERIAL_ECHO_F(destination[i]);
|
||||
}
|
||||
SERIAL_EOL();
|
||||
|
@ -348,7 +348,7 @@
|
||||
|
||||
bool report = true;
|
||||
const uint8_t index = parser.byteval('I');
|
||||
LOOP_XYZ(i) if (parser.seen(axis_codes[i])) {
|
||||
LOOP_XYZ(i) if (parser.seen(XYZ_CHAR(i))) {
|
||||
const int16_t value = parser.value_int();
|
||||
report = false;
|
||||
switch (i) {
|
||||
|
@ -135,7 +135,7 @@ void GcodeSuite::get_destination_from_command() {
|
||||
|
||||
// Get new XYZ position, whether absolute or relative
|
||||
LOOP_XYZ(i) {
|
||||
if ( (seen[i] = parser.seenval(axis_codes[i])) ) {
|
||||
if ( (seen[i] = parser.seenval(XYZ_CHAR(i))) ) {
|
||||
const float v = parser.value_axis_units((AxisEnum)i);
|
||||
if (skip_move)
|
||||
destination[i] = current_position[i];
|
||||
|
@ -38,7 +38,7 @@
|
||||
*/
|
||||
void GcodeSuite::M206() {
|
||||
LOOP_XYZ(i)
|
||||
if (parser.seen(axis_codes[i]))
|
||||
if (parser.seen(XYZ_CHAR(i)))
|
||||
set_home_offset((AxisEnum)i, parser.value_linear_units());
|
||||
|
||||
#if ENABLED(MORGAN_SCARA)
|
||||
|
@ -45,8 +45,8 @@
|
||||
|
||||
void report_xyz(const xyz_pos_t &pos, const uint8_t precision=3) {
|
||||
char str[12];
|
||||
for (uint8_t a = X_AXIS; a <= Z_AXIS; a++) {
|
||||
SERIAL_CHAR(' ', axis_codes[a], ':');
|
||||
LOOP_XYZ(a) {
|
||||
SERIAL_CHAR(' ', XYZ_CHAR(a), ':');
|
||||
SERIAL_ECHO(dtostrf(pos[a], 1, precision, str));
|
||||
}
|
||||
SERIAL_EOL();
|
||||
|
@ -76,8 +76,8 @@
|
||||
*/
|
||||
void GcodeSuite::M290() {
|
||||
#if ENABLED(BABYSTEP_XY)
|
||||
for (uint8_t a = X_AXIS; a <= Z_AXIS; a++)
|
||||
if (parser.seenval(axis_codes[a]) || (a == Z_AXIS && parser.seenval('S'))) {
|
||||
LOOP_XYZ(a)
|
||||
if (parser.seenval(XYZ_CHAR(a)) || (a == Z_AXIS && parser.seenval('S'))) {
|
||||
const float offs = constrain(parser.value_axis_units((AxisEnum)a), -2, 2);
|
||||
babystep.add_mm((AxisEnum)a, offs);
|
||||
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
|
||||
|
Reference in New Issue
Block a user