|
foxBMS-UnitTests
1.0.0
The foxBMS Unit Tests API Documentation
|
Go to the documentation of this file.
70 float y_interpolate = 0.0f;
75 slope = (y2 - y1) / (x2 - x1);
81 y_interpolate = y1 + (slope * (x_interpolate - x1));
87 return (val << 8) | (val >> 8);
91 val = ((val << 8) & 0xFF00FF00u) | ((val >> 8) & 0xFF00FFu);
92 return (val << 16) | (val >> 16);
96 val = ((val << 8) & 0xFF00FF00FF00FF00ull) | ((val >> 8) & 0x00FF00FF00FF00FFull);
97 val = ((val << 16) & 0xFFFF0000FFFF0000ull) | ((val >> 16) & 0x0000FFFF0000FFFFull);
98 return (val << 32) | (val >> 32);
102 return fminf(value1, value2);
106 int32_t absValue = INT32_MAX;
107 if (value != INT32_MIN) {
108 absValue = labs(value);
114 int64_t absValue = INT64_MAX;
115 if (value != INT64_MIN) {
116 absValue = llabs(value);
uint32_t MATH_swapBytes_uint32_t(uint32_t val)
Swap bytes of uint32_t value.
int32_t MATH_AbsInt32(int32_t value)
Returns the absolute value of passed int32_t value.
uint16_t MATH_swapBytes_uint16_t(uint16_t val)
Swap bytes of uint16_t value.
float MATH_minimumOfTwoFloats(float value1, float value2)
Returns the minimum of the passed float values.
math library for often used math functions
float MATH_linearInterpolation(float x1, float y1, float x2, float y2, float x_interpolate)
Linear inter-/extrapolates a third point according to two given points.
uint64_t MATH_swapBytes_uint64_t(uint64_t val)
Swap bytes of uint64_t value.
int64_t MATH_AbsInt64(int64_t value)
Returns the absolute value of passed int64_t value.