aboutsummaryrefslogtreecommitdiff
path: root/src/stm32/TODO/maths.c
blob: ef3698b38c0462e53df9df839c5165b5a832bb8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#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;
    else
        return x;
}