Skip to content

Commit f71feaa

Browse files
fix: change float to int16_t for quaternion functions
1 parent 570d803 commit f71feaa

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/NAxisMotion.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,7 @@ float NAxisMotion::readMag(int axis)
11861186
}
11871187

11881188
/* Quaternion */
1189-
void NAxisMotion::readQuaternion(float& w, float& x, float& y, float& z)
1189+
void NAxisMotion::readQuaternion(int16_t& w, int16_t& x, int16_t& y, int16_t& z)
11901190
{
11911191
if (dataUpdateMode == AUTO)
11921192
{
@@ -1198,7 +1198,7 @@ void NAxisMotion::readQuaternion(float& w, float& x, float& y, float& z)
11981198
z = quatData.z;
11991199
}
12001200

1201-
float NAxisMotion::readQuaternion(int axis)
1201+
int16_t NAxisMotion::readQuaternion(int axis)
12021202
{
12031203
if (dataUpdateMode == AUTO)
12041204
{
@@ -1215,12 +1215,12 @@ float NAxisMotion::readQuaternion(int axis)
12151215
}
12161216
}
12171217

1218-
void NAxisMotion::readQuat(float& w, float& x, float& y, float& z)
1218+
void NAxisMotion::readQuat(int16_t& w, int16_t& x, int16_t& y, int16_t& z)
12191219
{
12201220
readQuaternion(w, x, y, z);
12211221
}
12221222

1223-
float NAxisMotion::readQuat(int axis)
1223+
int16_t NAxisMotion::readQuat(int axis)
12241224
{
12251225
return readQuaternion(axis);
12261226
}

src/NAxisMotion.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -741,10 +741,10 @@ class NAxisMotion {
741741
float readMag(int axis);
742742

743743
/* QUATERNION */
744-
void readQuaternion(float& w, float& x, float& y, float& z);
745-
float readQuaternion(int axis);
746-
void readQuat(float& w, float& x, float& y, float& z);
747-
float readQuat(int quaternion);
744+
void readQuaternion(int16_t& w, int16_t& x, int16_t& y, int16_t& z);
745+
int16_t readQuaternion(int axis);
746+
void readQuat(float& w, int16_t& x, int16_t& y, int16_t& z);
747+
int16_t readQuat(int quaternion);
748748

749749
};
750750

0 commit comments

Comments
 (0)