Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: AX-12A Dynamixel mbed iothub_client EthernetInterface NTPClient ConfigFile SDFileSystem iothub_amqp_transport mbed-rtos proton-c-mbed wolfSSL
Diff: MeasureBuf.cpp
- Revision:
- 13:ffeff9b5e513
- Parent:
- 7:6723f6887d00
- Child:
- 17:0dbcbd8587fd
diff -r ac6c9d7f8c40 -r ffeff9b5e513 MeasureBuf.cpp
--- a/MeasureBuf.cpp Thu Jan 07 17:31:23 2016 +0000
+++ b/MeasureBuf.cpp Fri Jan 15 22:02:46 2016 +0000
@@ -6,12 +6,12 @@
SafeCircBuf<MeasureGroup, MeasureBufSize, uint32_t> MeasureBuf;
-void MeasureGroup::SetMeasure(NodeMeasure mId, time_t created, vector<float>& vals)
+void MeasureGroup::SetMeasure(NodeMeasure mId, time_t created, int numParts, float vals[])
{
MeasId = mId;
Created = created;
- NumVals = MAX_PARTS < vals.size() ? MAX_PARTS : vals.size();
+ NumVals = NUMJOINTS < numParts ? NUMJOINTS : numParts;
for (int ix = 0; ix < NumVals; ix++)
{
@@ -19,3 +19,15 @@
}
}
+MeasureGroup& MeasureGroup::operator=(const MeasureGroup& rhs)
+{
+ MeasId = rhs.MeasId;
+ Created = rhs.Created;
+ NumVals = rhs.NumVals;
+ for (int ix = 0; ix < NUMJOINTS; ix++)
+ {
+ MeasVals[ix] = rhs.MeasVals[ix];
+ }
+ return *this;
+}
+