Skip to content

Commit

Permalink
MicroBitCompassCalibrator avoid using max(int,int) (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinwork authored Jul 13, 2023
1 parent 2b8b410 commit ac70321
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/MicroBitCompassCalibrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ CompassCalibration MicroBitCompassCalibrator::spherify(Sample3D centre, Sample3D
// will place this point on the surface of the sphere.
float s = (radius / d) - 1;

scale = max(scale, s);
if (scale < s)
scale = s;

// next, determine the scale effect this has on each of our components.
float dx = (data[i].x - centre.x);
Expand Down

0 comments on commit ac70321

Please sign in to comment.