-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflightStates.c
66 lines (53 loc) · 1.5 KB
/
flightStates.c
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
// *******************************************************
//
// flightStates.c
//
// Enumeration to define the flight states, and related
// functions.
//
// Tom Rizzi, Euan Robinson, Satwik Meravanage
// Last modified: 21 May 2021
//
// *******************************************************
//*****************************************************************************
// Includes
//*****************************************************************************
#include <stdint.h>
#include "flightStates.h"
//*****************************************************************************
// Defines
//*****************************************************************************
#define MAX_STR_LEN 20;
//********************************************************
// Gets a string representation of the flight state
//********************************************************
char* getStateStr(uint32_t state)
{
switch (state)
{
case LANDED_LOCK:
return "LANDED";
break;
case LAUNCHING:
return "TAKEOFF";
break;
case SEEKING:
return "TAKEOFF";
break;
case SETTING:
return "TAKEOFF";
break;
case FLYING:
return "FLIGHT";
break;
case LANDING_TURN:
return "LANDING";
break;
case LANDING:
return "LANDING";
break;
case LANDED:
return "LANDED";
break;
}
}