summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--tracker-hatire/ftnoir_tracker_hat.cpp21
-rw-r--r--tracker-hatire/ftnoir_tracker_hat.h2
2 files changed, 7 insertions, 16 deletions
diff --git a/tracker-hatire/ftnoir_tracker_hat.cpp b/tracker-hatire/ftnoir_tracker_hat.cpp
index 3ec89499..d9f0a33b 100644
--- a/tracker-hatire/ftnoir_tracker_hat.cpp
+++ b/tracker-hatire/ftnoir_tracker_hat.cpp
@@ -15,17 +15,11 @@
hatire::hatire()
{
- HAT.Rot[0]=0;
- HAT.Rot[1]=0;
- HAT.Rot[2]=0;
- HAT.Trans[0]=0;
- HAT.Trans[1]=0;
- HAT.Trans[2]=0;
-
- Begin.append((unsigned char) 0xAA);
- Begin.append((unsigned char) 0xAA);
- End.append((unsigned char) 0x55);
- End.append((unsigned char) 0x55);
+
+ Begin.append((unsigned char) 0xAA);
+ Begin.append((unsigned char) 0xAA);
+ End.append((unsigned char) 0x55);
+ End.append((unsigned char) 0x55);
}
hatire::~hatire() = default;
@@ -146,11 +140,8 @@ void hatire::data(double *data)
{ s.EnableRoll, s.InvertRoll, HAT.Rot[s.RollAxis], data[Roll] },
};
- for (unsigned i = 0; i < std::size(spec); i++)
- {
- auto& k = spec[i];
+ for (auto& k : spec)
k.place = (k.sign ? -1 : 1) * (k.enable ? k.input : 0);
- }
}
#include "ftnoir_tracker_hat_dialog.h"
diff --git a/tracker-hatire/ftnoir_tracker_hat.h b/tracker-hatire/ftnoir_tracker_hat.h
index e7d9c0e4..0f88c7f6 100644
--- a/tracker-hatire/ftnoir_tracker_hat.h
+++ b/tracker-hatire/ftnoir_tracker_hat.h
@@ -33,7 +33,7 @@ public:
hatire_thread t;
private:
- TArduinoData ArduinoData, HAT;
+ TArduinoData ArduinoData {}, HAT {};
QByteArray Begin;
QByteArray End;