-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathMain.cpp
90 lines (70 loc) · 1.56 KB
/
Main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include "MotorNM.h"
#include "Motor.h"
#include "Player.h"
#include "CentrifugeTest.h"
// @see https://github.com/endurodave/StateMachine
// David Lafreniere
using namespace std;
int main(void)
{
// Create MotorNM (No Macro) test object
MotorNM motorNM;
// @see StateMachine.h comments
#if EXTERNAL_EVENT_NO_HEAP_DATA
MotorNMData dataNM;
dataNM.speed = 100;
motorNM.SetSpeed(&dataNM);
MotorNMData dataNM2;
dataNM2.speed = 200;
motorNM.SetSpeed(&dataNM2);
motorNM.Halt();
motorNM.Halt();
// Create Motor object with macro support
Motor motor;
MotorData data;
data.speed = 100;
motor.SetSpeed(&data);
MotorData data2;
data2.speed = 200;
motor.SetSpeed(&data2);
motor.Halt();
motor.Halt();
#else
MotorNMData* dataNM = new MotorNMData();
dataNM->speed = 100;
motorNM.SetSpeed(dataNM);
MotorNMData* dataNM2 = new MotorNMData();
dataNM2->speed = 200;
motorNM.SetSpeed(dataNM2);
motorNM.Halt();
motorNM.Halt();
// Create Motor object with macro support
Motor motor;
MotorData* data = new MotorData();
data->speed = 100;
motor.SetSpeed(data);
MotorData* data2 = new MotorData();
data2->speed = 200;
motor.SetSpeed(data2);
motor.Halt();
motor.Halt();
#endif
// Create Player instance and call external event functions
Player player;
player.OpenClose();
player.OpenClose();
player.Play();
player.Pause();
player.EndPause();
player.Stop();
player.Play();
player.Play();
player.OpenClose();
// Create CentrifugeTest and start test
CentrifugeTest test;
test.Cancel();
test.Start();
while (test.IsPollActive())
test.Poll();
return 0;
}