aboutsummaryrefslogtreecommitdiff
path: root/src/stm32/TODO/maths.c
blob: 2f4444a35ab1c993dd9a3bc5d7f1ae5d6accc582 (plain)
1
2
3
4
5
6
7
8
9
10
#include "maths.h"

float clamp( float* x, float *min, float *max ){
    if (*x < *min)
        return *min;
    else if (*x > *max)
        return *max;
    else
        return *x;
}