aboutsummaryrefslogtreecommitdiff
path: root/src/stm32/TODO/maths.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stm32/TODO/maths.c')
-rw-r--r--src/stm32/TODO/maths.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/stm32/TODO/maths.c b/src/stm32/TODO/maths.c
index ef3698b..2f4444a 100644
--- a/src/stm32/TODO/maths.c
+++ b/src/stm32/TODO/maths.c
@@ -1,12 +1,10 @@
#include "maths.h"
-#include <math.h>
-
-float clamp( float x, float min, float max ){
- if (x > max)
- return max;
- else if (x < min)
- return min;
+float clamp( float* x, float *min, float *max ){
+ if (*x < *min)
+ return *min;
+ else if (*x > *max)
+ return *max;
else
- return x;
+ return *x;
}