Merge remote-tracking branch 'origin/feature/light_weight_fsm' into development

This commit is contained in:
John Wellbelove 2018-09-12 17:36:28 +01:00
commit 0ec2a1f06f
2 changed files with 11 additions and 11 deletions

View File

@ -86,21 +86,21 @@ namespace etl
//*************************************************************************
struct transition
{
transition(const event_id_t event_id_,
const state_id_t current_state_id_,
transition(const state_id_t current_state_id_,
const event_id_t event_id_,
const state_id_t next_state_id_,
void (TObject::* const action_)() = nullptr,
bool (TObject::* const guard_)() = nullptr)
: event_id(event_id_),
current_state_id(current_state_id_),
: current_state_id(current_state_id_),
event_id(event_id_),
next_state_id(next_state_id_),
action(action_),
guard(guard_)
{
}
const event_id_t event_id;
const state_id_t current_state_id;
const event_id_t event_id;
const state_id_t next_state_id;
void (TObject::* const action)();
bool (TObject::* const guard)();

View File

@ -211,12 +211,12 @@ namespace
//***************************************************************************
const etl::array<MotorControl::transition, 6> MotorControl::transitionTable =
{
MotorControl::transition(EventId::START, StateId::IDLE, StateId::RUNNING, &MotorControl::OnStart, &MotorControl::Guard),
MotorControl::transition(EventId::START, StateId::IDLE, StateId::IDLE, &MotorControl::Null, &MotorControl::NotGuard),
MotorControl::transition(EventId::STOP, StateId::RUNNING, StateId::WINDING_DOWN, &MotorControl::OnStop),
MotorControl::transition(EventId::STOPPED, StateId::WINDING_DOWN, StateId::IDLE, &MotorControl::OnStopped),
MotorControl::transition(EventId::EMERGENCY_STOP, StateId::RUNNING, StateId::IDLE, &MotorControl::OnStop),
MotorControl::transition(EventId::SET_SPEED, StateId::RUNNING, StateId::RUNNING, &MotorControl::OnSetSpeed)
MotorControl::transition(StateId::IDLE, EventId::START, StateId::RUNNING, &MotorControl::OnStart, &MotorControl::Guard),
MotorControl::transition(StateId::IDLE, EventId::START, StateId::IDLE, &MotorControl::Null, &MotorControl::NotGuard),
MotorControl::transition(StateId::RUNNING, EventId::STOP, StateId::WINDING_DOWN, &MotorControl::OnStop),
MotorControl::transition(StateId::RUNNING, EventId::EMERGENCY_STOP, StateId::IDLE, &MotorControl::OnStop),
MotorControl::transition(StateId::RUNNING, EventId::SET_SPEED, StateId::RUNNING, &MotorControl::OnSetSpeed),
MotorControl::transition(StateId::WINDING_DOWN, EventId::STOPPED, StateId::IDLE, &MotorControl::OnStopped)
};
//***************************************************************************