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
ActionBuf.cpp
- Committer:
- henryrawas
- Date:
- 2016-01-06
- Revision:
- 10:9b21566a5ddb
- Parent:
- 8:d98e2dec0f40
- Child:
- 13:ffeff9b5e513
File content as of revision 10:9b21566a5ddb:
#include "mbed.h"
#include "rtos.h"
#include "ActionBuf.h"
SafeCircBuf<ActionGroup, ActionBufSize, uint32_t> ActionBuf;
bool ActionGroup::SetAction(ArmAction aId, char* args)
{
if (strlen(args) < ActionArgSize)
{
ActionId = aId;
strcpy(ActionArg, args);
return true;
}
return false;
}
ActionSequence::ActionSequence()
{
};
ActionSequence::ActionSequence(SequenceAction aType)
{
ActionType = aType;
Param = 0;
};
ActionSequence::ActionSequence(SequenceAction aType, vector<float>& vals, int param)
{
ActionType = aType;
GoalVals = vals;
Param = param;
}
ActionSequence::ActionSequence(SequenceAction aType, int parts, float vals[], int param)
{
ActionType = aType;
GoalVals.clear();
for (int i = 0; i < parts; i++)
GoalVals.push_back(vals[i]);
Param = param;
}
void ActionSequence::SetGoal(vector<float>& vals)
{
GoalVals = vals;
}
void ActionSequence::SetParam(int param)
{
Param = param;
}
void ActionSequence::SetAction(SequenceAction aType)
{
ActionType = aType;
}