Реализован уровень обработки данных драйвера IMU

This commit is contained in:
2026-04-14 17:36:05 +03:00
parent d59cf7cd55
commit 52922afeb1
10 changed files with 466 additions and 0 deletions

View 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;
}