|
@@ -1001,46 +1001,44 @@
|
1001
|
1001
|
lcd_quick_feedback();
|
1002
|
1002
|
#endif
|
1003
|
1003
|
|
1004
|
|
- x_pos = current_position[X_AXIS];
|
1005
|
|
- y_pos = current_position[Y_AXIS];
|
1006
|
|
- x_flag = 0;
|
1007
|
|
- y_flag = 0;
|
1008
|
|
- repeat_flag = 0;
|
|
1004
|
+ x_flag = code_seen('X') && code_has_value();
|
|
1005
|
+ y_flag = code_seen('Y') && code_has_value();
|
|
1006
|
+ x_pos = x_flag ? code_value_float() : current_position[X_AXIS];
|
|
1007
|
+ y_pos = y_flag ? code_value_float() : current_position[Y_AXIS];
|
|
1008
|
+ repeat_flag = code_seen('R') ? code_value_bool() : false;
|
|
1009
|
+
|
|
1010
|
+ bool err_flag = false;
|
1009
|
1011
|
|
1010
|
1012
|
g29_verbose_level = code_seen('V') ? code_value_int() : 0;
|
1011
|
1013
|
if (!WITHIN(g29_verbose_level, 0, 4)) {
|
1012
|
1014
|
SERIAL_PROTOCOLLNPGM("Invalid Verbose Level specified. (0-4)\n");
|
1013
|
|
- return UBL_ERR;
|
|
1015
|
+ err_flag = true;
|
1014
|
1016
|
}
|
1015
|
1017
|
|
1016
|
1018
|
if (code_seen('G')) {
|
1017
|
|
- grid_size_G = 3;
|
1018
|
|
- if (code_has_value())
|
1019
|
|
- grid_size_G = code_value_int();
|
|
1019
|
+ grid_size_G = code_has_value() ? code_value_int() : 3;
|
1020
|
1020
|
if (!WITHIN(grid_size_G, 2, 10)) {
|
1021
|
1021
|
SERIAL_PROTOCOLLNPGM("Invalid grid probe points specified.\n");
|
1022
|
|
- return UBL_ERR;
|
|
1022
|
+ err_flag = true;
|
1023
|
1023
|
}
|
1024
|
1024
|
}
|
1025
|
1025
|
|
1026
|
|
- x_flag = code_seen('X') && code_has_value();
|
1027
|
|
- x_pos = x_flag ? code_value_float() : current_position[X_AXIS];
|
|
1026
|
+ if (x_flag != y_flag) {
|
|
1027
|
+ SERIAL_PROTOCOLLNPGM("Both X & Y locations must be specified.\n");
|
|
1028
|
+ err_flag = true;
|
|
1029
|
+ }
|
|
1030
|
+
|
1028
|
1031
|
if (!WITHIN(RAW_X_POSITION(x_pos), X_MIN_POS, X_MAX_POS)) {
|
1029
|
1032
|
SERIAL_PROTOCOLLNPGM("Invalid X location specified.\n");
|
1030
|
|
- return UBL_ERR;
|
|
1033
|
+ err_flag = true;
|
1031
|
1034
|
}
|
1032
|
1035
|
|
1033
|
|
- y_flag = code_seen('Y') && code_has_value();
|
1034
|
|
- y_pos = y_flag ? code_value_float() : current_position[Y_AXIS];
|
1035
|
1036
|
if (!WITHIN(RAW_Y_POSITION(y_pos), Y_MIN_POS, Y_MAX_POS)) {
|
1036
|
1037
|
SERIAL_PROTOCOLLNPGM("Invalid Y location specified.\n");
|
1037
|
|
- return UBL_ERR;
|
|
1038
|
+ err_flag = true;
|
1038
|
1039
|
}
|
1039
|
1040
|
|
1040
|
|
- if (x_flag != y_flag) {
|
1041
|
|
- SERIAL_PROTOCOLLNPGM("Both X & Y locations must be specified.\n");
|
1042
|
|
- return UBL_ERR;
|
1043
|
|
- }
|
|
1041
|
+ if (err_flag) return UBL_ERR;
|
1044
|
1042
|
|
1045
|
1043
|
if (code_seen('A')) { // Activate the Unified Bed Leveling System
|
1046
|
1044
|
ubl.state.active = 1;
|
|
@@ -1069,7 +1067,6 @@
|
1069
|
1067
|
}
|
1070
|
1068
|
#endif
|
1071
|
1069
|
|
1072
|
|
- repeat_flag = code_seen('R');
|
1073
|
1070
|
repetition_cnt = repeat_flag ? (code_has_value() ? code_value_int() : 9999) : 1;
|
1074
|
1071
|
if (repetition_cnt < 1) {
|
1075
|
1072
|
SERIAL_PROTOCOLLNPGM("Invalid Repetition count.\n");
|