demo project

Dependencies:   AX-12A Dynamixel mbed iothub_client EthernetInterface NTPClient ConfigFile SDFileSystem iothub_amqp_transport mbed-rtos proton-c-mbed wolfSSL

Committer:
henryrawas
Date:
Sat Jan 23 00:08:30 2016 +0000
Revision:
18:224289104fc0
Parent:
MeasureBuf.cpp@17:0dbcbd8587fd
Child:
19:2f0ec9ac1238
refactor

Who changed what in which revision?

UserRevisionLine numberNew contents of line
henryrawas 4:36a4eceb1b7f 1 #include "mbed.h"
henryrawas 4:36a4eceb1b7f 2
henryrawas 4:36a4eceb1b7f 3 #include "MeasureBuf.h"
henryrawas 4:36a4eceb1b7f 4
henryrawas 4:36a4eceb1b7f 5
henryrawas 4:36a4eceb1b7f 6
henryrawas 17:0dbcbd8587fd 7 SafeCircBuf<MeasureSnapshot, MeasureBufSize, uint32_t> MeasureBuf;
henryrawas 4:36a4eceb1b7f 8
henryrawas 18:224289104fc0 9 void MeasureGroup::SetMeasure(int numParts, float vals[])
henryrawas 4:36a4eceb1b7f 10 {
henryrawas 13:ffeff9b5e513 11 NumVals = NUMJOINTS < numParts ? NUMJOINTS : numParts;
henryrawas 4:36a4eceb1b7f 12
henryrawas 4:36a4eceb1b7f 13 for (int ix = 0; ix < NumVals; ix++)
henryrawas 4:36a4eceb1b7f 14 {
henryrawas 4:36a4eceb1b7f 15 MeasVals[ix] = vals[ix];
henryrawas 4:36a4eceb1b7f 16 }
henryrawas 4:36a4eceb1b7f 17 }
henryrawas 4:36a4eceb1b7f 18
henryrawas 13:ffeff9b5e513 19 MeasureGroup& MeasureGroup::operator=(const MeasureGroup& rhs)
henryrawas 13:ffeff9b5e513 20 {
henryrawas 13:ffeff9b5e513 21 NumVals = rhs.NumVals;
henryrawas 13:ffeff9b5e513 22 for (int ix = 0; ix < NUMJOINTS; ix++)
henryrawas 13:ffeff9b5e513 23 {
henryrawas 13:ffeff9b5e513 24 MeasVals[ix] = rhs.MeasVals[ix];
henryrawas 13:ffeff9b5e513 25 }
henryrawas 13:ffeff9b5e513 26 return *this;
henryrawas 13:ffeff9b5e513 27 }
henryrawas 13:ffeff9b5e513 28