|
@@ -305,7 +305,7 @@ void unified_bed_leveling::G29() {
|
305
|
305
|
bool probe_deployed = false;
|
306
|
306
|
if (G29_parse_parameters()) return; // Abort on parameter error
|
307
|
307
|
|
308
|
|
- const int8_t p_val = parser.intval('P', -1);
|
|
308
|
+ const uint8_t p_val = parser.byteval('P');
|
309
|
309
|
const bool may_move = p_val == 1 || p_val == 2 || p_val == 4 || parser.seen_test('J');
|
310
|
310
|
#if ENABLED(HAS_MULTI_HOTEND)
|
311
|
311
|
const uint8_t old_tool_index = active_extruder;
|
|
@@ -321,7 +321,7 @@ void unified_bed_leveling::G29() {
|
321
|
321
|
|
322
|
322
|
// Invalidate one or more nearby mesh points, possibly all.
|
323
|
323
|
if (parser.seen('I')) {
|
324
|
|
- int16_t count = parser.has_value() ? parser.value_int() : 1;
|
|
324
|
+ uint8_t count = parser.has_value() ? parser.value_byte() : 1;
|
325
|
325
|
bool invalidate_all = count >= GRID_MAX_POINTS;
|
326
|
326
|
if (!invalidate_all) {
|
327
|
327
|
while (count--) {
|
|
@@ -345,7 +345,7 @@ void unified_bed_leveling::G29() {
|
345
|
345
|
}
|
346
|
346
|
|
347
|
347
|
if (parser.seen('Q')) {
|
348
|
|
- const int test_pattern = parser.has_value() ? parser.value_int() : -99;
|
|
348
|
+ const int16_t test_pattern = parser.has_value() ? parser.value_int() : -99;
|
349
|
349
|
if (!WITHIN(test_pattern, -1, 2)) {
|
350
|
350
|
SERIAL_ECHOLNPGM("Invalid test_pattern value. (-1 to 2)\n");
|
351
|
351
|
return;
|
|
@@ -592,7 +592,7 @@ void unified_bed_leveling::G29() {
|
592
|
592
|
//
|
593
|
593
|
|
594
|
594
|
if (parser.seen('L')) { // Load Current Mesh Data
|
595
|
|
- param.KLS_storage_slot = parser.has_value() ? parser.value_int() : storage_slot;
|
|
595
|
+ param.KLS_storage_slot = parser.has_value() ? (int8_t)parser.value_int() : storage_slot;
|
596
|
596
|
|
597
|
597
|
int16_t a = settings.calc_num_meshes();
|
598
|
598
|
|
|
@@ -617,10 +617,10 @@ void unified_bed_leveling::G29() {
|
617
|
617
|
//
|
618
|
618
|
|
619
|
619
|
if (parser.seen('S')) { // Store (or Save) Current Mesh Data
|
620
|
|
- param.KLS_storage_slot = parser.has_value() ? parser.value_int() : storage_slot;
|
|
620
|
+ param.KLS_storage_slot = parser.has_value() ? (int8_t)parser.value_int() : storage_slot;
|
621
|
621
|
|
622
|
|
- if (param.KLS_storage_slot == -1) // Special case, the user wants to 'Export' the mesh to the
|
623
|
|
- return report_current_mesh(); // host program to be saved on the user's computer
|
|
622
|
+ if (param.KLS_storage_slot == -1) // Special case: 'Export' the mesh to the
|
|
623
|
+ return report_current_mesh(); // host so it can be saved in a file.
|
624
|
624
|
|
625
|
625
|
int16_t a = settings.calc_num_meshes();
|
626
|
626
|
|
|
@@ -673,7 +673,7 @@ void unified_bed_leveling::G29() {
|
673
|
673
|
*/
|
674
|
674
|
void unified_bed_leveling::adjust_mesh_to_mean(const bool cflag, const_float_t offset) {
|
675
|
675
|
float sum = 0;
|
676
|
|
- int n = 0;
|
|
676
|
+ uint8_t n = 0;
|
677
|
677
|
GRID_LOOP(x, y)
|
678
|
678
|
if (!isnan(z_values[x][y])) {
|
679
|
679
|
sum += z_values[x][y];
|
|
@@ -734,7 +734,7 @@ void unified_bed_leveling::shift_mesh_height() {
|
734
|
734
|
do {
|
735
|
735
|
if (do_ubl_mesh_map) display_map(param.T_map_type);
|
736
|
736
|
|
737
|
|
- const int point_num = (GRID_MAX_POINTS) - count + 1;
|
|
737
|
+ const uint8_t point_num = (GRID_MAX_POINTS - count) + 1;
|
738
|
738
|
SERIAL_ECHOLNPAIR("Probing mesh point ", point_num, "/", GRID_MAX_POINTS, ".");
|
739
|
739
|
TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_MESH), point_num, int(GRID_MAX_POINTS)));
|
740
|
740
|
|
|
@@ -1083,7 +1083,7 @@ bool unified_bed_leveling::G29_parse_parameters() {
|
1083
|
1083
|
param.R_repetition = 0;
|
1084
|
1084
|
|
1085
|
1085
|
if (parser.seen('R')) {
|
1086
|
|
- param.R_repetition = parser.has_value() ? parser.value_int() : GRID_MAX_POINTS;
|
|
1086
|
+ param.R_repetition = parser.has_value() ? parser.value_byte() : GRID_MAX_POINTS;
|
1087
|
1087
|
NOMORE(param.R_repetition, GRID_MAX_POINTS);
|
1088
|
1088
|
if (param.R_repetition < 1) {
|
1089
|
1089
|
SERIAL_ECHOLNPGM("?(R)epetition count invalid (1+).\n");
|
|
@@ -1091,14 +1091,14 @@ bool unified_bed_leveling::G29_parse_parameters() {
|
1091
|
1091
|
}
|
1092
|
1092
|
}
|
1093
|
1093
|
|
1094
|
|
- param.V_verbosity = parser.intval('V');
|
|
1094
|
+ param.V_verbosity = parser.byteval('V');
|
1095
|
1095
|
if (!WITHIN(param.V_verbosity, 0, 4)) {
|
1096
|
1096
|
SERIAL_ECHOLNPGM("?(V)erbose level implausible (0-4).\n");
|
1097
|
1097
|
err_flag = true;
|
1098
|
1098
|
}
|
1099
|
1099
|
|
1100
|
1100
|
if (parser.seen('P')) {
|
1101
|
|
- const int pv = parser.value_int();
|
|
1101
|
+ const uint8_t pv = parser.value_byte();
|
1102
|
1102
|
#if !HAS_BED_PROBE
|
1103
|
1103
|
if (pv == 1) {
|
1104
|
1104
|
SERIAL_ECHOLNPGM("G29 P1 requires a probe.\n");
|
|
@@ -1181,7 +1181,7 @@ bool unified_bed_leveling::G29_parse_parameters() {
|
1181
|
1181
|
}
|
1182
|
1182
|
#endif
|
1183
|
1183
|
|
1184
|
|
- param.T_map_type = parser.intval('T');
|
|
1184
|
+ param.T_map_type = parser.byteval('T');
|
1185
|
1185
|
if (!WITHIN(param.T_map_type, 0, 2)) {
|
1186
|
1186
|
SERIAL_ECHOLNPGM("Invalid map type.\n");
|
1187
|
1187
|
return UBL_ERR;
|
|
@@ -1833,7 +1833,7 @@ void unified_bed_leveling::smart_fill_mesh() {
|
1833
|
1833
|
return;
|
1834
|
1834
|
}
|
1835
|
1835
|
|
1836
|
|
- param.KLS_storage_slot = parser.value_int();
|
|
1836
|
+ param.KLS_storage_slot = (int8_t)parser.value_int();
|
1837
|
1837
|
|
1838
|
1838
|
float tmp_z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];
|
1839
|
1839
|
settings.load_mesh(param.KLS_storage_slot, &tmp_z_values);
|