status now always reports position

This commit is contained in:
2019-07-29 22:03:22 +03:00
parent 4d15c1e5ff
commit f1c26251f6
14 changed files with 211 additions and 117 deletions

View File

@@ -2,6 +2,16 @@
#include "common/Commands.h"
Command::Command(CommandType type, float arg1, float arg2, float arg3,
float arg4, float arg5, float arg6)
: type(type),
arg1(arg1),
arg2(arg2),
arg3(arg3),
arg4(arg4),
arg5(arg5),
arg6(arg6){};
Command::Command(float *floats) { fromFloats(floats); }
void Command::fromFloats(float *floats) {
@@ -41,13 +51,3 @@ void Command::toBytes(byte *bytes) {
floatToBytes(&bytes[i * i2cFloatSize], floats[i]);
}
}
void bytesToFloat(float *target, byte *val) {
memcpy(target, val, i2cFloatSize);
return;
}
void floatToBytes(byte *target, float val) {
memcpy(target, &val, i2cFloatSize);
return;
}