Browse Source

Cleanups to gcode.h, use seenval()

pull/1/head
Scott Lahteine 8 years ago
parent
commit
12f092c812
  1. 12
      Marlin/G26_Mesh_Validation_Tool.cpp
  2. 128
      Marlin/Marlin_main.cpp
  3. 22
      Marlin/gcode.h
  4. 12
      Marlin/ubl_G29.cpp

12
Marlin/G26_Mesh_Validation_Tool.cpp

@ -638,11 +638,11 @@
g26_hotend_temp = HOTEND_TEMP;
g26_prime_flag = 0;
g26_ooze_amount = parser.seen('O') && parser.has_value() ? parser.value_linear_units() : OOZE_AMOUNT;
g26_ooze_amount = parser.seenval('O') ? parser.value_linear_units() : OOZE_AMOUNT;
g26_keep_heaters_on = parser.seen('K') && parser.value_bool();
g26_continue_with_closest = parser.seen('C') && parser.value_bool();
if (parser.seen('B')) {
if (parser.seenval('B')) {
g26_bed_temp = parser.value_celsius();
if (!WITHIN(g26_bed_temp, 15, 140)) {
SERIAL_PROTOCOLLNPGM("?Specified bed temperature not plausible.");
@ -650,7 +650,7 @@
}
}
if (parser.seen('L')) {
if (parser.seenval('L')) {
g26_layer_height = parser.value_linear_units();
if (!WITHIN(g26_layer_height, 0.0, 2.0)) {
SERIAL_PROTOCOLLNPGM("?Specified layer height not plausible.");
@ -672,7 +672,7 @@
}
}
if (parser.seen('S')) {
if (parser.seenval('S')) {
g26_nozzle = parser.value_float();
if (!WITHIN(g26_nozzle, 0.1, 1.0)) {
SERIAL_PROTOCOLLNPGM("?Specified nozzle size not plausible.");
@ -699,7 +699,7 @@
}
}
if (parser.seen('F')) {
if (parser.seenval('F')) {
g26_filament_diameter = parser.value_linear_units();
if (!WITHIN(g26_filament_diameter, 1.0, 4.0)) {
SERIAL_PROTOCOLLNPGM("?Specified filament size not plausible.");
@ -712,7 +712,7 @@
g26_extrusion_multiplier *= g26_filament_diameter * sq(g26_nozzle) / sq(0.3); // Scale up by nozzle size
if (parser.seen('H')) {
if (parser.seenval('H')) {
g26_hotend_temp = parser.value_celsius();
if (!WITHIN(g26_hotend_temp, 165, 280)) {
SERIAL_PROTOCOLLNPGM("?Specified nozzle temperature not plausible.");

128
Marlin/Marlin_main.cpp

@ -1277,7 +1277,7 @@ void get_available_commands() {
* Returns TRUE if the target is invalid
*/
bool get_target_extruder_from_command(const uint16_t code) {
if (parser.seen('T')) {
if (parser.seenval('T')) {
const int8_t e = parser.value_byte();
if (e >= EXTRUDERS) {
SERIAL_ECHO_START();
@ -3135,7 +3135,7 @@ static void homeaxis(const AxisEnum axis) {
const char* mixing_codes = "ABCDHI";
byte mix_bits = 0;
for (uint8_t i = 0; i < MIXING_STEPPERS; i++) {
if (parser.seen(mixing_codes[i])) {
if (parser.seenval(mixing_codes[i])) {
SBI(mix_bits, i);
float v = parser.value_float();
NOLESS(v, 0.0);
@ -3304,7 +3304,7 @@ inline void gcode_G0_G1(
#endif
float arc_offset[2] = { 0.0, 0.0 };
if (parser.seen('R')) {
if (parser.seenval('R')) {
const float r = parser.value_linear_units(),
p1 = current_position[X_AXIS], q1 = current_position[Y_AXIS],
p2 = destination[X_AXIS], q2 = destination[Y_AXIS];
@ -3321,8 +3321,8 @@ inline void gcode_G0_G1(
}
}
else {
if (parser.seen('I')) arc_offset[0] = parser.value_linear_units();
if (parser.seen('J')) arc_offset[1] = parser.value_linear_units();
if (parser.seenval('I')) arc_offset[0] = parser.value_linear_units();
if (parser.seenval('J')) arc_offset[1] = parser.value_linear_units();
}
if (arc_offset[0] || arc_offset[1]) {
@ -3358,8 +3358,8 @@ inline void gcode_G0_G1(
inline void gcode_G4() {
millis_t dwell_ms = 0;
if (parser.seen('P')) dwell_ms = parser.value_millis(); // milliseconds to wait
if (parser.seen('S')) dwell_ms = parser.value_millis_from_seconds(); // seconds to wait
if (parser.seenval('P')) dwell_ms = parser.value_millis(); // milliseconds to wait
if (parser.seenval('S')) dwell_ms = parser.value_millis_from_seconds(); // seconds to wait
stepper.synchronize();
refresh_cmd_timeout();
@ -4111,7 +4111,7 @@ void home_all_axes() { gcode_G28(true); }
break;
case MeshSet:
if (parser.seen('X')) {
if (parser.seenval('X')) {
px = parser.value_int() - 1;
if (!WITHIN(px, 0, GRID_MAX_POINTS_X - 1)) {
SERIAL_PROTOCOLLNPGM("X out of range (1-" STRINGIFY(GRID_MAX_POINTS_X) ").");
@ -4123,7 +4123,7 @@ void home_all_axes() { gcode_G28(true); }
return;
}
if (parser.seen('Y')) {
if (parser.seenval('Y')) {
py = parser.value_int() - 1;
if (!WITHIN(py, 0, GRID_MAX_POINTS_Y - 1)) {
SERIAL_PROTOCOLLNPGM("Y out of range (1-" STRINGIFY(GRID_MAX_POINTS_Y) ").");
@ -4135,7 +4135,7 @@ void home_all_axes() { gcode_G28(true); }
return;
}
if (parser.seen('Z')) {
if (parser.seenval('Z')) {
mbl.z_values[px][py] = parser.value_linear_units();
}
else {
@ -4145,7 +4145,7 @@ void home_all_axes() { gcode_G28(true); }
break;
case MeshSetZOffset:
if (parser.seen('Z')) {
if (parser.seenval('Z')) {
mbl.z_offset = parser.value_linear_units();
}
else {
@ -4371,17 +4371,17 @@ void home_all_axes() { gcode_G28(true); }
return;
}
const float z = parser.seen('Z') && parser.has_value() ? parser.value_float() : RAW_CURRENT_POSITION(Z);
const float z = parser.seenval('Z') ? parser.value_float() : RAW_CURRENT_POSITION(Z);
if (!WITHIN(z, -10, 10)) {
SERIAL_ERROR_START();
SERIAL_ERRORLNPGM("Bad Z value");
return;
}
const float x = parser.seen('X') && parser.has_value() ? parser.value_float() : NAN,
y = parser.seen('Y') && parser.has_value() ? parser.value_float() : NAN;
int8_t i = parser.seen('I') && parser.has_value() ? parser.value_byte() : -1,
j = parser.seen('J') && parser.has_value() ? parser.value_byte() : -1;
const float x = parser.seenval('X') ? parser.value_float() : NAN,
y = parser.seenval('Y') ? parser.value_float() : NAN;
int8_t i = parser.seenval('I') ? parser.value_byte() : -1,
j = parser.seenval('J') ? parser.value_byte() : -1;
if (!isnan(x) && !isnan(y)) {
// Get nearest i / j from x / y
@ -4413,7 +4413,7 @@ void home_all_axes() { gcode_G28(true); }
#endif
verbose_level = parser.seen('V') && parser.has_value() ? parser.value_int() : 0;
verbose_level = parser.seenval('V') ? parser.value_int() : 0;
if (!WITHIN(verbose_level, 0, 4)) {
SERIAL_PROTOCOLLNPGM("?(V)erbose level is implausible (0-4).");
return;
@ -4433,7 +4433,7 @@ void home_all_axes() { gcode_G28(true); }
// These values may be saved with the completed mesh
abl_grid_points_x = parser.seen('X') ? parser.value_int() : GRID_MAX_POINTS_X;
abl_grid_points_y = parser.seen('Y') ? parser.value_int() : GRID_MAX_POINTS_Y;
if (parser.seen('P')) abl_grid_points_x = abl_grid_points_y = parser.value_int();
if (parser.seenval('P')) abl_grid_points_x = abl_grid_points_y = parser.value_int();
if (abl_grid_points_x < 2 || abl_grid_points_y < 2) {
SERIAL_PROTOCOLLNPGM("?Number of probe points is implausible (2 minimum).");
@ -5595,7 +5595,7 @@ void home_all_axes() { gcode_G28(true); }
// If any axis has enough movement, do the move
LOOP_XYZ(i)
if (FABS(destination[i] - current_position[i]) >= G38_MINIMUM_MOVE) {
if (!parser.seen('F')) feedrate_mm_s = homing_feedrate(i);
if (!parser.seenval('F')) feedrate_mm_s = homing_feedrate(i);
// If G38.2 fails throw an error
if (!G38_run_probe() && is_38_2) {
SERIAL_ERROR_START();
@ -5616,10 +5616,10 @@ void home_all_axes() { gcode_G28(true); }
*/
inline void gcode_G42() {
if (IsRunning()) {
const bool hasI = parser.seen('I');
const int8_t ix = parser.has_value() ? parser.value_int() : 0;
const bool hasJ = parser.seen('J');
const int8_t iy = parser.has_value() ? parser.value_int() : 0;
const bool hasI = parser.seenval('I');
const int8_t ix = hasI ? parser.value_int() : 0;
const bool hasJ = parser.seenval('J');
const int8_t iy = hasJ ? parser.value_int() : 0;
if ((hasI && !WITHIN(ix, 0, GRID_MAX_POINTS_X - 1)) || (hasJ && !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1))) {
SERIAL_ECHOLNPGM(MSG_ERR_MESH_XY);
@ -5664,12 +5664,12 @@ void home_all_axes() { gcode_G28(true); }
*/
inline void gcode_G92() {
bool didXYZ = false,
didE = parser.seen('E');
didE = parser.seenval('E');
if (!didE) stepper.synchronize();
LOOP_XYZE(i) {
if (parser.seen(axis_codes[i])) {
if (parser.seenval(axis_codes[i])) {
#if IS_SCARA
current_position[i] = parser.value_axis_units((AxisEnum)i);
if (i != E_AXIS) didXYZ = true;
@ -5715,11 +5715,11 @@ inline void gcode_G92() {
millis_t ms = 0;
bool hasP = false, hasS = false;
if (parser.seen('P')) {
if (parser.seenval('P')) {
ms = parser.value_millis(); // milliseconds to wait
hasP = ms > 0;
}
if (parser.seen('S')) {
if (parser.seenval('S')) {
ms = parser.value_millis_from_seconds(); // seconds to wait
hasS = ms > 0;
}
@ -6272,7 +6272,7 @@ inline void gcode_M17() {
* M26: Set SD Card file index
*/
inline void gcode_M26() {
if (card.cardOK && parser.seen('S'))
if (card.cardOK && parser.seenval('S'))
card.setIndex(parser.value_long());
}
@ -6334,7 +6334,7 @@ inline void gcode_M31() {
if (card.cardOK) {
card.openFile(namestartpos, true, call_procedure);
if (parser.seen('S'))
if (parser.seenval('S'))
card.setIndex(parser.value_long());
card.startFileprint();
@ -6370,8 +6370,8 @@ inline void gcode_M31() {
*/
inline void gcode_M34() {
if (parser.seen('S')) card.setSortOn(parser.value_bool());
if (parser.seen('F')) {
int v = parser.value_long();
if (parser.seenval('F')) {
const int v = parser.value_long();
card.setSortFolders(v < 0 ? -1 : v > 0 ? 1 : 0);
}
//if (parser.seen('R')) card.setSortReverse(parser.value_bool());
@ -6404,10 +6404,8 @@ static bool pin_is_protected(const int8_t pin) {
* S<byte> Pin status from 0 - 255
*/
inline void gcode_M42() {
if (!parser.seen('S')) return;
const int pin_status = parser.value_int();
if (!WITHIN(pin_status, 0, 255)) return;
if (!parser.seenval('S')) return;
const byte pin_status = parser.value_byte();
int pin_number = parser.seen('P') ? parser.value_int() : LED_PIN;
if (pin_number < 0) return;
@ -6666,8 +6664,8 @@ inline void gcode_M42() {
}
// Get the range of pins to test or watch
const uint8_t first_pin = parser.seen('P') ? parser.value_byte() : 0,
last_pin = parser.seen('P') ? first_pin : NUM_DIGITAL_PINS - 1;
const uint8_t first_pin = parser.seenval('P') ? parser.value_byte() : 0,
last_pin = parser.seenval('P') ? first_pin : NUM_DIGITAL_PINS - 1;
if (first_pin > last_pin) return;
@ -7026,7 +7024,7 @@ inline void gcode_M104() {
if (target_extruder != active_extruder) return;
#endif
if (parser.seen('S')) {
if (parser.seenval('S')) {
const int16_t temp = parser.value_celsius();
thermalManager.setTargetHotend(temp, target_extruder);
@ -7153,7 +7151,7 @@ inline void gcode_M105() {
* M155: Set temperature auto-report interval. M155 S<seconds>
*/
inline void gcode_M155() {
if (parser.seen('S')) {
if (parser.seenval('S')) {
auto_report_temp_interval = parser.value_byte();
NOMORE(auto_report_temp_interval, 60);
next_temp_report_ms = millis() + 1000UL * auto_report_temp_interval;
@ -7240,8 +7238,8 @@ inline void gcode_M109() {
if (target_extruder != active_extruder) return;
#endif
const bool no_wait_for_cooling = parser.seen('S');
if (no_wait_for_cooling || parser.seen('R')) {
const bool no_wait_for_cooling = parser.seenval('S');
if (no_wait_for_cooling || parser.seenval('R')) {
const int16_t temp = parser.value_celsius();
thermalManager.setTargetHotend(temp, target_extruder);
@ -7389,8 +7387,8 @@ inline void gcode_M109() {
if (DEBUGGING(DRYRUN)) return;
LCD_MESSAGEPGM(MSG_BED_HEATING);
const bool no_wait_for_cooling = parser.seen('S');
if (no_wait_for_cooling || parser.seen('R')) {
const bool no_wait_for_cooling = parser.seenval('S');
if (no_wait_for_cooling || parser.seenval('R')) {
thermalManager.setTargetBed(parser.value_celsius());
#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
if (parser.value_celsius() > BED_MINTEMP)
@ -7497,7 +7495,7 @@ inline void gcode_M109() {
* M110: Set Current Line Number
*/
inline void gcode_M110() {
if (parser.seen('N')) gcode_LastN = parser.value_long();
if (parser.seenval('N')) gcode_LastN = parser.value_long();
}
/**
@ -7547,7 +7545,7 @@ inline void gcode_M111() {
* S<seconds> Optional. Set the keepalive interval.
*/
inline void gcode_M113() {
if (parser.seen('S')) {
if (parser.seenval('S')) {
host_keepalive_interval = parser.value_byte();
NOMORE(host_keepalive_interval, 60);
}
@ -7590,7 +7588,7 @@ inline void gcode_M111() {
*/
inline void gcode_M140() {
if (DEBUGGING(DRYRUN)) return;
if (parser.seen('S')) thermalManager.setTargetBed(parser.value_celsius());
if (parser.seenval('S')) thermalManager.setTargetBed(parser.value_celsius());
}
#if ENABLED(ULTIPANEL)
@ -7611,16 +7609,16 @@ inline void gcode_M140() {
}
else {
int v;
if (parser.seen('H')) {
if (parser.seenval('H')) {
v = parser.value_int();
lcd_preheat_hotend_temp[material] = constrain(v, EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - 15);
}
if (parser.seen('F')) {
if (parser.seenval('F')) {
v = parser.value_int();
lcd_preheat_fan_speed[material] = constrain(v, 0, 255);
}
#if TEMP_SENSOR_BED != 0
if (parser.seen('B')) {
if (parser.seenval('B')) {
v = parser.value_int();
lcd_preheat_bed_temp[material] = constrain(v, BED_MINTEMP, BED_MAXTEMP - 15);
}
@ -7635,9 +7633,9 @@ inline void gcode_M140() {
* M149: Set temperature units
*/
inline void gcode_M149() {
if (parser.seen('C')) parser.set_input_temp_units(TEMPUNIT_C);
else if (parser.seen('K')) parser.set_input_temp_units(TEMPUNIT_K);
else if (parser.seen('F')) parser.set_input_temp_units(TEMPUNIT_F);
if (parser.seenval('C')) parser.set_input_temp_units(TEMPUNIT_C);
else if (parser.seenval('K')) parser.set_input_temp_units(TEMPUNIT_K);
else if (parser.seenval('F')) parser.set_input_temp_units(TEMPUNIT_F);
}
#endif
@ -7726,7 +7724,7 @@ inline void gcode_M83() { axis_relative_modes[E_AXIS] = true; }
* M18, M84: Disable stepper motors
*/
inline void gcode_M18_M84() {
if (parser.seen('S')) {
if (parser.seenval('S')) {
stepper_inactive_time = parser.value_millis_from_seconds();
}
else {
@ -8448,11 +8446,11 @@ inline void gcode_M211() {
inline void gcode_M218() {
if (get_target_extruder_from_command(218) || target_extruder == 0) return;
if (parser.seen('X')) hotend_offset[X_AXIS][target_extruder] = parser.value_linear_units();
if (parser.seen('Y')) hotend_offset[Y_AXIS][target_extruder] = parser.value_linear_units();
if (parser.seenval('X')) hotend_offset[X_AXIS][target_extruder] = parser.value_linear_units();
if (parser.seenval('Y')) hotend_offset[Y_AXIS][target_extruder] = parser.value_linear_units();
#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_NOZZLE)
if (parser.seen('Z')) hotend_offset[Z_AXIS][target_extruder] = parser.value_linear_units();
if (parser.seenval('Z')) hotend_offset[Z_AXIS][target_extruder] = parser.value_linear_units();
#endif
SERIAL_ECHO_START();
@ -8476,7 +8474,7 @@ inline void gcode_M211() {
* M220: Set speed percentage factor, aka "Feed Rate" (M220 S95)
*/
inline void gcode_M220() {
if (parser.seen('S')) feedrate_percentage = parser.value_int();
if (parser.seenval('S')) feedrate_percentage = parser.value_int();
}
/**
@ -8484,7 +8482,7 @@ inline void gcode_M220() {
*/
inline void gcode_M221() {
if (get_target_extruder_from_command(221)) return;
if (parser.seen('S'))
if (parser.seenval('S'))
flow_percentage[target_extruder] = parser.value_int();
}
@ -9777,14 +9775,14 @@ inline void gcode_M907() {
* S# determines MS1 or MS2, X# sets the pin high/low.
*/
inline void gcode_M351() {
if (parser.seen('S')) switch (parser.value_byte()) {
if (parser.seenval('S')) switch (parser.value_byte()) {
case 1:
LOOP_XYZE(i) if (parser.seen(axis_codes[i])) stepper.microstep_ms(i, parser.value_byte(), -1);
if (parser.seen('B')) stepper.microstep_ms(4, parser.value_byte(), -1);
LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, parser.value_byte(), -1);
if (parser.seenval('B')) stepper.microstep_ms(4, parser.value_byte(), -1);
break;
case 2:
LOOP_XYZE(i) if (parser.seen(axis_codes[i])) stepper.microstep_ms(i, -1, parser.value_byte());
if (parser.seen('B')) stepper.microstep_ms(4, -1, parser.value_byte());
LOOP_XYZE(i) if (parser.seenval(axis_codes[i])) stepper.microstep_ms(i, -1, parser.value_byte());
if (parser.seenval('B')) stepper.microstep_ms(4, -1, parser.value_byte());
break;
}
stepper.microstep_readings();
@ -9827,8 +9825,8 @@ inline void gcode_M907() {
inline void gcode_M355() {
#if HAS_CASE_LIGHT
uint8_t args = 0;
if (parser.seen('P')) ++args, case_light_brightness = parser.value_byte();
if (parser.seen('S')) ++args, case_light_on = parser.value_bool();
if (parser.seenval('P')) ++args, case_light_brightness = parser.value_byte();
if (parser.seenval('S')) ++args, case_light_on = parser.value_bool();
if (args) update_case_light();
// always report case light status

22
Marlin/gcode.h

@ -132,7 +132,7 @@ public:
#define SEEN_TEST(L) TEST(codebits[(L - 'A') >> 3], (L - 'A') & 0x7)
#else
#else // !FASTER_GCODE_PARSER
// Code is found in the string. If not found, value_ptr is unchanged.
// This allows "if (seen('A')||seen('B'))" to use the last-found value.
@ -147,7 +147,7 @@ public:
#define SEEN_TEST(L) !!strchr(command_args, L)
#endif // FASTER_GCODE_PARSER
#endif // !FASTER_GCODE_PARSER
// Populate all fields by parsing a single line of GCode
// This uses 54 bytes of SRAM to speed up seen/value
@ -157,7 +157,7 @@ public:
FORCE_INLINE static bool has_value() { return value_ptr != NULL; }
// Seen and has value
FORCE_INLINE static bool seenval(const char c) { return seen(c) && has_value(); }
inline static bool seenval(const char c) { return seen(c) && has_value(); }
static volatile bool seen_axis() {
return SEEN_TEST('X') || SEEN_TEST('Y') || SEEN_TEST('Z') || SEEN_TEST('E');
@ -184,20 +184,20 @@ public:
}
// Code value as a long or ulong
inline static long value_long() { return value_ptr ? strtol(value_ptr, NULL, 10) : 0L; }
inline unsigned static long value_ulong() { return value_ptr ? strtoul(value_ptr, NULL, 10) : 0UL; }
inline static int32_t value_long() { return value_ptr ? strtol(value_ptr, NULL, 10) : 0L; }
inline static uint32_t value_ulong() { return value_ptr ? strtoul(value_ptr, NULL, 10) : 0UL; }
// Code value for use as time
FORCE_INLINE static millis_t value_millis() { return value_ulong(); }
FORCE_INLINE static millis_t value_millis_from_seconds() { return value_float() * 1000UL; }
// Reduce to fewer bits
FORCE_INLINE static int value_int() { return (int)value_long(); }
FORCE_INLINE uint16_t value_ushort() { return (uint16_t)value_long(); }
inline static uint8_t value_byte() { return (uint8_t)(constrain(value_long(), 0, 255)); }
FORCE_INLINE static int16_t value_int() { return (int16_t)value_long(); }
FORCE_INLINE static uint16_t value_ushort() { return (uint16_t)value_long(); }
inline static uint8_t value_byte() { return (uint8_t)constrain(value_long(), 0, 255); }
// Bool is true with no value or non-zero
inline static bool value_bool() { return !has_value() || value_byte(); }
inline static bool value_bool() { return !has_value() || value_byte(); }
// Units modes: Inches, Fahrenheit, Kelvin
@ -282,12 +282,12 @@ public:
}
}
#else
#else // !TEMPERATURE_UNITS_SUPPORT
FORCE_INLINE static float value_celsius() { return value_float(); }
FORCE_INLINE static float value_celsius_diff() { return value_float(); }
#endif
#endif // !TEMPERATURE_UNITS_SUPPORT
FORCE_INLINE static float value_feedrate() { return value_linear_units(); }

12
Marlin/ubl_G29.cpp

@ -314,7 +314,7 @@
// Check for commands that require the printer to be homed
if (axis_unhomed_error()) {
const int8_t p_val = parser.seen('P') && parser.has_value() ? parser.value_int() : -1;
const int8_t p_val = parser.seenval('P') ? parser.value_int() : -1;
if (p_val == 1 || p_val == 2 || p_val == 4 || parser.seen('J'))
home_all_axes();
}
@ -492,7 +492,7 @@
return;
}
const float height = parser.seen('H') && parser.has_value() ? parser.value_float() : Z_CLEARANCE_BETWEEN_PROBES;
const float height = parser.seenval('H') ? parser.value_float() : Z_CLEARANCE_BETWEEN_PROBES;
manually_probe_remaining_mesh(g29_x_pos, g29_y_pos, height, g29_card_thickness, parser.seen('T'));
SERIAL_PROTOCOLLNPGM("G29 P2 finished.");
@ -1094,9 +1094,9 @@
g29_constant = 0.0;
g29_repetition_cnt = 0;
g29_x_flag = parser.seen('X') && parser.has_value();
g29_x_flag = parser.seenval('X');
g29_x_pos = g29_x_flag ? parser.value_float() : current_position[X_AXIS];
g29_y_flag = parser.seen('Y') && parser.has_value();
g29_y_flag = parser.seenval('Y');
g29_y_pos = g29_y_flag ? parser.value_float() : current_position[Y_AXIS];
if (parser.seen('R')) {
@ -1170,7 +1170,7 @@
g29_constant = parser.value_float();
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
if (parser.seen('F') && parser.has_value()) {
if (parser.seenval('F')) {
const float fh = parser.value_float();
if (!WITHIN(fh, 0.0, 100.0)) {
SERIAL_PROTOCOLLNPGM("?(F)ade height for Bed Level Correction not plausible.\n");
@ -1180,7 +1180,7 @@
}
#endif
g29_map_type = parser.seen('T') && parser.has_value() ? parser.value_int() : 0;
g29_map_type = parser.seenval('T') ? parser.value_int() : 0;
if (!WITHIN(g29_map_type, 0, 2)) {
SERIAL_PROTOCOLLNPGM("Invalid map type.\n");
return UBL_ERR;

Loading…
Cancel
Save