init

Dependencies:   MPU6050 PinDetect circular_buffer

Committer:
OsmanKameric
Date:
Tue Nov 07 16:35:14 2017 +0000
Revision:
0:b416214256cd
FIRST

Who changed what in which revision?

UserRevisionLine numberNew contents of line
OsmanKameric 0:b416214256cd 1 #include <Moving.h>
OsmanKameric 0:b416214256cd 2 #include <Stacionary.h>
OsmanKameric 0:b416214256cd 3 #include <Fsm.h>
OsmanKameric 0:b416214256cd 4
OsmanKameric 0:b416214256cd 5 FsmStates::FsmStates() : movingState_(new Moving(*this,timer)),
OsmanKameric 0:b416214256cd 6 stacionaryState_(new Stacionary(*this,timer))
OsmanKameric 0:b416214256cd 7 {
OsmanKameric 0:b416214256cd 8 currentState(stacionaryState());
OsmanKameric 0:b416214256cd 9 }
OsmanKameric 0:b416214256cd 10
OsmanKameric 0:b416214256cd 11
OsmanKameric 0:b416214256cd 12
OsmanKameric 0:b416214256cd 13 State* FsmStates::stacionaryState()
OsmanKameric 0:b416214256cd 14 {
OsmanKameric 0:b416214256cd 15 return stacionaryState_;
OsmanKameric 0:b416214256cd 16 }
OsmanKameric 0:b416214256cd 17
OsmanKameric 0:b416214256cd 18 State* FsmStates::movingState()
OsmanKameric 0:b416214256cd 19 {
OsmanKameric 0:b416214256cd 20 return movingState_;
OsmanKameric 0:b416214256cd 21 }
OsmanKameric 0:b416214256cd 22
OsmanKameric 0:b416214256cd 23 State* FsmStates::currentState()
OsmanKameric 0:b416214256cd 24 {
OsmanKameric 0:b416214256cd 25 return currentState_;
OsmanKameric 0:b416214256cd 26 }
OsmanKameric 0:b416214256cd 27 void FsmStates::currentState(State* state)
OsmanKameric 0:b416214256cd 28 {
OsmanKameric 0:b416214256cd 29 currentState_ = state;
OsmanKameric 0:b416214256cd 30 }
OsmanKameric 0:b416214256cd 31
OsmanKameric 0:b416214256cd 32 FsmStates::~FsmStates()
OsmanKameric 0:b416214256cd 33 {
OsmanKameric 0:b416214256cd 34 delete stacionaryState_;
OsmanKameric 0:b416214256cd 35 delete movingState_;
OsmanKameric 0:b416214256cd 36 }
OsmanKameric 0:b416214256cd 37
OsmanKameric 0:b416214256cd 38 Fsm::Fsm() : states_()
OsmanKameric 0:b416214256cd 39 {
OsmanKameric 0:b416214256cd 40
OsmanKameric 0:b416214256cd 41
OsmanKameric 0:b416214256cd 42 }
OsmanKameric 0:b416214256cd 43
OsmanKameric 0:b416214256cd 44
OsmanKameric 0:b416214256cd 45