Subversion Repositories FlightCtrl

Rev

Rev 1910 | Rev 2102 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1910 Rev 2099
Line 21... Line 21...
21
#define SIGNAL_BAD  2
21
#define SIGNAL_BAD  2
22
#define SIGNAL_OK   3
22
#define SIGNAL_OK   3
23
#define SIGNAL_GOOD 4
23
#define SIGNAL_GOOD 4
Line 24... Line 24...
24
 
24
 
25
/*
25
/*
26
 * The EATR arrays
26
 * The PRTY arrays
27
 */
27
 */
28
#define CONTROL_ELEVATOR 0
28
#define CONTROL_ELEVATOR 0
29
#define CONTROL_AILERONS 1
29
#define CONTROL_AILERONS 1
30
#define CONTROL_THROTTLE 2
30
#define CONTROL_THROTTLE 2
Line 31... Line 31...
31
#define CONTROL_RUDDER   3
31
#define CONTROL_RUDDER   3
-
 
32
 
-
 
33
/*
-
 
34
 * Looping flags.
-
 
35
 * LOOPING_UP || LOOPING_DOWN <=> LOOPING_PITCH_AXIS
-
 
36
 * LOOPING_LEFT || LOOPING_RIGHT <=> LOOPING_ROLL_AXIS
-
 
37
 */
-
 
38
#define LOOPING_UP         (1<<0)
-
 
39
#define LOOPING_DOWN       (1<<1)
-
 
40
#define LOOPING_LEFT       (1<<2)
-
 
41
#define LOOPING_RIGHT      (1<<3)
-
 
42
#define LOOPING_PITCH_AXIS (1<<4)
-
 
43
#define LOOPING_ROLL_AXIS  (1<<5)
32
 
44
 
33
/*
45
/*
34
 * This is only relevant for "abstract controls" ie. all control sources have the
46
 * This is only relevant for "abstract controls" ie. all control sources have the
35
 * same interface. This struct of code pointers is used like an abstract class
47
 * same interface. This struct of code pointers is used like an abstract class
36
 * definition from object-oriented languages, and all control input implementations
48
 * definition from object-oriented languages, and all control input implementations
Line 57... Line 69...
57
} t_control;
69
} t_control;
Line 58... Line 70...
58
 
70
 
59
/*
71
/*
60
 * Our output.
72
 * Our output.
61
 */
73
 */
62
extern int16_t control[4];
-
 
63
extern int32_t controlIntegrals[4];
74
extern int16_t controls[4];
64
extern uint16_t controlActivity;
75
extern uint16_t controlActivity;
65
extern uint16_t maxControl[2];
-
 
66
 
-
 
67
extern volatile uint8_t MKFlags;
-
 
Line 68... Line 76...
68
extern uint16_t isFlying;
76
//extern uint16_t maxControl[2];
69
 
77
 
Line 70... Line 78...
70
void controlMixer_initVariables(void);
78
void controlMixer_initVariables(void);
Line 71... Line 79...
71
void controlMixer_updateVariables(void);
79
//void controlMixer_updateVariables(void);
72
 
80
 
73
void controlMixer_setNeutral(void);
81
void controlMixer_setNeutral(void);
74
 
82
 
Line 75... Line 83...
75
/*
83
/*
76
 * Update the exported variables. Called at every flight control cycle.
84
 * Update the exported variables. Called at every flight control cycle.
77
 */
85
 */
78
void controlMixer_update(void);
86
void controlMixer_periodicTask(void);
Line 79... Line 87...
79
 
87
 
Line 80... Line 88...
80
/*
88
/*
-
 
89
 * Get the current command. See the COMMAND_.... define's
Line 81... Line 90...
81
 * Get the current command. See the COMMAND_.... define's
90
 */
82
 */
91
uint8_t controlMixer_getCommand(void);
83
uint8_t controlMixer_getCommand(void);
92
 
84
 
93
void controlMixer_performCalibrationCommands(uint8_t command);
Line 109... Line 118...
109
 * + <--
118
 * + <--
110
 *    0
119
 *    0
111
 *
120
 *
112
 * Not in any of these positions: 0
121
 * Not in any of these positions: 0
113
 */
122
 */
114
// void controlMixer_handleCommands(void);
-
 
115
uint8_t controlMixer_getArgument(void);
123
uint8_t controlMixer_getArgument(void);
116
uint8_t controlMixer_isCommandRepeated(void);
124
uint8_t controlMixer_isCommandRepeated(void);
117
// TODO: Abstract away if possible.
-
 
118
uint8_t controlMixer_testCompassCalState(void);
-