demo project
Dependencies: AX-12A Dynamixel mbed iothub_client EthernetInterface NTPClient ConfigFile SDFileSystem iothub_amqp_transport mbed-rtos proton-c-mbed wolfSSL
Diff: Utils/MeasureBuf.cpp
- Revision:
- 18:224289104fc0
- Parent:
- 17:0dbcbd8587fd
- Child:
- 19:2f0ec9ac1238
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Utils/MeasureBuf.cpp Sat Jan 23 00:08:30 2016 +0000 @@ -0,0 +1,28 @@ +#include "mbed.h" + +#include "MeasureBuf.h" + + + +SafeCircBuf<MeasureSnapshot, MeasureBufSize, uint32_t> MeasureBuf; + +void MeasureGroup::SetMeasure(int numParts, float vals[]) +{ + NumVals = NUMJOINTS < numParts ? NUMJOINTS : numParts; + + for (int ix = 0; ix < NumVals; ix++) + { + MeasVals[ix] = vals[ix]; + } +} + +MeasureGroup& MeasureGroup::operator=(const MeasureGroup& rhs) +{ + NumVals = rhs.NumVals; + for (int ix = 0; ix < NUMJOINTS; ix++) + { + MeasVals[ix] = rhs.MeasVals[ix]; + } + return *this; +} +