|
@@ -757,8 +757,8 @@
|
757
|
757
|
location = find_closest_mesh_point_of_type(INVALID, lx, ly, 1, NULL, do_furthest); // the '1' says we want the location to be relative to the probe
|
758
|
758
|
if (location.x_index >= 0 && location.y_index >= 0) {
|
759
|
759
|
|
760
|
|
- const float rawx = ubl.mesh_index_to_xpos[location.x_index],
|
761
|
|
- rawy = ubl.mesh_index_to_ypos[location.y_index];
|
|
760
|
+ const float rawx = pgm_read_float(&(ubl.mesh_index_to_xpos[location.x_index])),
|
|
761
|
+ rawy = pgm_read_float(&(ubl.mesh_index_to_ypos[location.y_index]));
|
762
|
762
|
|
763
|
763
|
// TODO: Change to use `position_is_reachable` (for SCARA-compatibility)
|
764
|
764
|
if (!WITHIN(rawx, MIN_PROBE_X, MAX_PROBE_X) || !WITHIN(rawy, MIN_PROBE_Y, MAX_PROBE_Y)) {
|
|
@@ -905,8 +905,8 @@
|
905
|
905
|
// It doesn't matter if the probe can't reach the NAN location. This is a manual probe.
|
906
|
906
|
if (location.x_index < 0 && location.y_index < 0) continue;
|
907
|
907
|
|
908
|
|
- const float rawx = ubl.mesh_index_to_xpos[location.x_index],
|
909
|
|
- rawy = ubl.mesh_index_to_ypos[location.y_index];
|
|
908
|
+ const float rawx = pgm_read_float(&(ubl.mesh_index_to_xpos[location.x_index])),
|
|
909
|
+ rawy = pgm_read_float(&(ubl.mesh_index_to_ypos[location.y_index]));
|
910
|
910
|
|
911
|
911
|
// TODO: Change to use `position_is_reachable` (for SCARA-compatibility)
|
912
|
912
|
if (!WITHIN(rawx, X_MIN_POS, X_MAX_POS) || !WITHIN(rawy, Y_MIN_POS, Y_MAX_POS)) {
|
|
@@ -1174,7 +1174,7 @@
|
1174
|
1174
|
|
1175
|
1175
|
SERIAL_PROTOCOLPGM("X-Axis Mesh Points at: ");
|
1176
|
1176
|
for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) {
|
1177
|
|
- SERIAL_PROTOCOL_F(LOGICAL_X_POSITION(ubl.mesh_index_to_xpos[i]), 1);
|
|
1177
|
+ SERIAL_PROTOCOL_F(LOGICAL_X_POSITION(pgm_read_float(&(ubl.mesh_index_to_xpos[i]))), 1);
|
1178
|
1178
|
SERIAL_PROTOCOLPGM(" ");
|
1179
|
1179
|
safe_delay(50);
|
1180
|
1180
|
}
|
|
@@ -1182,7 +1182,7 @@
|
1182
|
1182
|
|
1183
|
1183
|
SERIAL_PROTOCOLPGM("Y-Axis Mesh Points at: ");
|
1184
|
1184
|
for (uint8_t i = 0; i < GRID_MAX_POINTS_Y; i++) {
|
1185
|
|
- SERIAL_PROTOCOL_F(LOGICAL_Y_POSITION(ubl.mesh_index_to_ypos[i]), 1);
|
|
1185
|
+ SERIAL_PROTOCOL_F(LOGICAL_Y_POSITION(pgm_read_float(&(ubl.mesh_index_to_ypos[i]))), 1);
|
1186
|
1186
|
SERIAL_PROTOCOLPGM(" ");
|
1187
|
1187
|
safe_delay(50);
|
1188
|
1188
|
}
|
|
@@ -1320,8 +1320,8 @@
|
1320
|
1320
|
|
1321
|
1321
|
// We only get here if we found a Mesh Point of the specified type
|
1322
|
1322
|
|
1323
|
|
- const float rawx = ubl.mesh_index_to_xpos[i], // Check if we can probe this mesh location
|
1324
|
|
- rawy = ubl.mesh_index_to_ypos[j];
|
|
1323
|
+ const float rawx = pgm_read_float(&(ubl.mesh_index_to_xpos[i])), // Check if we can probe this mesh location
|
|
1324
|
+ rawy = pgm_read_float(&(ubl.mesh_index_to_ypos[j]));
|
1325
|
1325
|
|
1326
|
1326
|
// If using the probe as the reference there are some unreachable locations.
|
1327
|
1327
|
// Prune them from the list and ignore them till the next Phase (manual nozzle probing).
|
|
@@ -1386,8 +1386,8 @@
|
1386
|
1386
|
bit_clear(not_done, location.x_index, location.y_index); // Mark this location as 'adjusted' so we will find a
|
1387
|
1387
|
// different location the next time through the loop
|
1388
|
1388
|
|
1389
|
|
- const float rawx = ubl.mesh_index_to_xpos[location.x_index],
|
1390
|
|
- rawy = ubl.mesh_index_to_ypos[location.y_index];
|
|
1389
|
+ const float rawx = pgm_read_float(&(ubl.mesh_index_to_xpos[location.x_index])),
|
|
1390
|
+ rawy = pgm_read_float(&(ubl.mesh_index_to_ypos[location.y_index]));
|
1391
|
1391
|
|
1392
|
1392
|
// TODO: Change to use `position_is_reachable` (for SCARA-compatibility)
|
1393
|
1393
|
if (!WITHIN(rawx, X_MIN_POS, X_MAX_POS) || !WITHIN(rawy, Y_MIN_POS, Y_MAX_POS)) { // In theory, we don't need this check.
|
|
@@ -1482,7 +1482,8 @@
|
1482
|
1482
|
//find min & max probeable points in the mesh
|
1483
|
1483
|
for (xCount = 0; xCount < GRID_MAX_POINTS_X; xCount++) {
|
1484
|
1484
|
for (yCount = 0; yCount < GRID_MAX_POINTS_Y; yCount++) {
|
1485
|
|
- if (WITHIN(ubl.mesh_index_to_xpos[xCount], MIN_PROBE_X, MAX_PROBE_X) && WITHIN(ubl.mesh_index_to_ypos[yCount], MIN_PROBE_Y, MAX_PROBE_Y)) {
|
|
1485
|
+ if (WITHIN(pgm_read_float(&(ubl.mesh_index_to_xpos[xCount])), MIN_PROBE_X, MAX_PROBE_X) &&
|
|
1486
|
+ WITHIN(pgm_read_float(&(ubl.mesh_index_to_ypos[yCount])), MIN_PROBE_Y, MAX_PROBE_Y)) {
|
1486
|
1487
|
NOMORE(x_min, xCount);
|
1487
|
1488
|
NOLESS(x_max, xCount);
|
1488
|
1489
|
NOMORE(y_min, yCount);
|
|
@@ -1577,11 +1578,12 @@
|
1577
|
1578
|
}
|
1578
|
1579
|
//SERIAL_ECHOPAIR("\nCheckpoint: ", 5);
|
1579
|
1580
|
|
1580
|
|
- const float probeX = ubl.mesh_index_to_xpos[grid_G_index_to_xpos[xCount]], //where we want the probe to be
|
1581
|
|
- probeY = ubl.mesh_index_to_ypos[grid_G_index_to_ypos[yCount]];
|
|
1581
|
+ const float probeX = pgm_read_float(&(ubl.mesh_index_to_xpos[grid_G_index_to_xpos[xCount]])), //where we want the probe to be
|
|
1582
|
+ probeY = pgm_read_float(&(ubl.mesh_index_to_ypos[grid_G_index_to_ypos[yCount]]));
|
1582
|
1583
|
//SERIAL_ECHOPAIR("\nCheckpoint: ", 6);
|
1583
|
1584
|
|
1584
|
|
- const float measured_z = probe_pt(LOGICAL_X_POSITION(probeX), LOGICAL_Y_POSITION(probeY), code_seen('E'), (code_seen('V') && code_has_value()) ? code_value_int() : 0); // takes into account the offsets
|
|
1585
|
+ const float measured_z = probe_pt(LOGICAL_X_POSITION(probeX), LOGICAL_Y_POSITION(probeY), code_seen('E'),
|
|
1586
|
+ (code_seen('V') && code_has_value()) ? code_value_int() : 0); // takes into account the offsets
|
1585
|
1587
|
|
1586
|
1588
|
//SERIAL_ECHOPAIR("\nmeasured_z: ", measured_z);
|
1587
|
1589
|
|
|
@@ -1595,7 +1597,7 @@
|
1595
|
1597
|
restore_ubl_active_state_and_leave();
|
1596
|
1598
|
|
1597
|
1599
|
// ?? ubl.has_control_of_lcd_panel = true;
|
1598
|
|
- //do_blocking_move_to_xy(ubl.mesh_index_to_xpos[grid_G_index_to_xpos[0]], ubl.mesh_index_to_ypos[grid_G_index_to_ypos[0]]);
|
|
1600
|
+ //do_blocking_move_to_xy(pgm_read_float(&(ubl.mesh_index_to_xpos[grid_G_index_to_xpos[0]])),pgm_read_float(&(ubl.mesh_index_to_ypos[grid_G_index_to_ypos[0]])));
|
1599
|
1601
|
|
1600
|
1602
|
// least squares code
|
1601
|
1603
|
double xxx5[] = { 0,50,100,150,200, 20,70,120,165,195, 0,50,100,150,200, 0,55,100,150,200, 0,65,100,150,205 },
|