|
@@ -58,22 +58,22 @@
|
58
|
58
|
}
|
59
|
59
|
|
60
|
60
|
int8_t cell_index_x(float x) {
|
61
|
|
- int8_t cx = int(x - (MESH_MIN_X)) / (MESH_X_DIST);
|
|
61
|
+ int8_t cx = (x - (MESH_MIN_X)) / (MESH_X_DIST);
|
62
|
62
|
return constrain(cx, 0, (MESH_NUM_X_POINTS) - 2);
|
63
|
63
|
}
|
64
|
64
|
|
65
|
65
|
int8_t cell_index_y(float y) {
|
66
|
|
- int8_t cy = int(y - (MESH_MIN_Y)) / (MESH_Y_DIST);
|
|
66
|
+ int8_t cy = (y - (MESH_MIN_Y)) / (MESH_Y_DIST);
|
67
|
67
|
return constrain(cy, 0, (MESH_NUM_Y_POINTS) - 2);
|
68
|
68
|
}
|
69
|
69
|
|
70
|
70
|
int8_t probe_index_x(float x) {
|
71
|
|
- int8_t px = int(x - (MESH_MIN_X) + (MESH_X_DIST) / 2) / (MESH_X_DIST);
|
|
71
|
+ int8_t px = (x - (MESH_MIN_X) + (MESH_X_DIST) * 0.5) / (MESH_X_DIST);
|
72
|
72
|
return (px >= 0 && px < (MESH_NUM_X_POINTS)) ? px : -1;
|
73
|
73
|
}
|
74
|
74
|
|
75
|
75
|
int8_t probe_index_y(float y) {
|
76
|
|
- int8_t py = int(y - (MESH_MIN_Y) + (MESH_Y_DIST) / 2) / (MESH_Y_DIST);
|
|
76
|
+ int8_t py = (y - (MESH_MIN_Y) + (MESH_Y_DIST) * 0.5) / (MESH_Y_DIST);
|
77
|
77
|
return (py >= 0 && py < (MESH_NUM_Y_POINTS)) ? py : -1;
|
78
|
78
|
}
|
79
|
79
|
|