Реализован уровень обработки данных драйвера IMU
This commit is contained in:
14
Source/MathEnv/MathFunc.cpp
Normal file
14
Source/MathEnv/MathFunc.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include "MathFunc.h"
|
||||
|
||||
float Normalize(float Value, float Scale, float Min, float Max)
|
||||
{
|
||||
const float len = (Max - Min) / 2.0f;
|
||||
const float shift = (Max + Min) / 2.0f;
|
||||
return (Value - shift) * Scale / len;
|
||||
}
|
||||
|
||||
short Rev16(short v)
|
||||
{
|
||||
asm("REV16 %1, %0" : "=r" (v) : "r" (v)); // v = v<<8 | v>>8;
|
||||
return v;
|
||||
}
|
||||
Reference in New Issue
Block a user