1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 14:25:20 +03:00

Moving constrain to the include file and making it static inline

This commit is contained in:
JOhn Aughey 2016-05-03 17:44:49 -05:00
parent 5ffb3b5068
commit 8310c6f050
2 changed files with 20 additions and 23 deletions

View file

@ -111,26 +111,6 @@ int32_t applyDeadband(int32_t value, int32_t deadband)
return value;
}
inline int constrain(int amt, int low, int high)
{
if (amt < low)
return low;
else if (amt > high)
return high;
else
return amt;
}
inline float constrainf(float amt, float low, float high)
{
if (amt < low)
return low;
else if (amt > high)
return high;
else
return amt;
}
void devClear(stdev_t *dev)
{
dev->m_n = 0;