Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey1994 committed Jan 2, 2021
2 parents e3b55d6 + e3444e3 commit a0c8a67
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
Binary file modified third_party/gForceSDKCXX/compiled/Release/gForceSDKWrapper.dll
Binary file not shown.
Binary file modified third_party/gForceSDKCXX/compiled/Release/gForceSDKWrapper32.dll
Binary file not shown.
10 changes: 6 additions & 4 deletions third_party/gForceSDKCXX/src/inc/gforce_wrapper_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@
#pragma pack(push, 1)
struct GforceData
{
double data[9];
static const int SIZE = 9;

double data[SIZE];
double timestamp;

GforceData (double *data, double timestamp)
{
memcpy (this->data, data, sizeof (double) * 8);
memcpy (this->data, data, sizeof (double) * SIZE);
this->timestamp = timestamp;
}

GforceData ()
{
timestamp = 0.0;
for (int i = 0; i < 8; i++)
for (int i = 0; i < SIZE; i++)
{
data[i] = 0;
}
Expand All @@ -26,7 +28,7 @@ struct GforceData
GforceData (const GforceData &other)
{
timestamp = other.timestamp;
memcpy (data, other.data, sizeof (double) * 8);
memcpy (data, other.data, sizeof (double) * SIZE);
}
};
#pragma pack(pop)
Expand Down
2 changes: 1 addition & 1 deletion third_party/gForceSDKCXX/src/wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ int gforceGetData (void *param)
struct GforceData data = data_queue.at (
0); // at ensures out of range exception, front has undefined behavior
board_data->timestamp = data.timestamp;
for (int i = 0; i < 8; i++)
for (int i = 0; i < GforceData::SIZE; i++)
{
board_data->data[i] = data.data[i];
}
Expand Down

0 comments on commit a0c8a67

Please sign in to comment.