optimisation: Move divison into constexpr
Change in memory: Flash: -12 bytes SRAM: 0 bytes
This commit is contained in:
parent
6b12be42d9
commit
a9d0cc5e56
|
|
@ -2186,12 +2186,14 @@ inline void scan_bed_induction_sensor_point()
|
|||
|
||||
float __attribute__((noinline)) BED_X(const uint8_t col)
|
||||
{
|
||||
return ((float)col * (BED_Xn - BED_X0) / (MESH_NUM_X_POINTS - 1) + BED_X0);
|
||||
constexpr float x_mesh_density = (BED_Xn - BED_X0) / (MESH_NUM_X_POINTS - 1);
|
||||
return ((float)col * x_mesh_density + BED_X0);
|
||||
}
|
||||
|
||||
float __attribute__((noinline)) BED_Y(const uint8_t row)
|
||||
{
|
||||
return ((float)row * (BED_Yn - BED_Y0) / (MESH_NUM_Y_POINTS - 1) + BED_Y0);
|
||||
constexpr float y_mesh_density = (BED_Yn - BED_Y0) / (MESH_NUM_Y_POINTS - 1);
|
||||
return ((float)row * y_mesh_density + BED_Y0);
|
||||
}
|
||||
|
||||
BedSkewOffsetDetectionResultType find_bed_offset_and_skew(int8_t verbosity_level, uint8_t &too_far_mask)
|
||||
|
|
|
|||
Loading…
Reference in New Issue