Rev 1775 | Rev 2048 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1775 | Rev 1960 | ||
---|---|---|---|
1 | /*********************************************************************************/ |
1 | /*********************************************************************************/ |
2 | /* Flight Control */ |
2 | /* Flight Control */ |
3 | /*********************************************************************************/ |
3 | /*********************************************************************************/ |
4 | 4 | ||
5 | #ifndef _FLIGHT_H |
5 | #ifndef _FLIGHT_H |
6 | #define _FLIGHT_H |
6 | #define _FLIGHT_H |
7 | 7 | ||
8 | #include <inttypes.h> |
8 | #include <inttypes.h> |
9 | #include "analog.h" |
9 | #include "analog.h" |
10 | #include "configuration.h" |
10 | #include "configuration.h" |
11 | 11 | ||
12 | #define PITCH 0 |
12 | #define PITCH 0 |
13 | #define ROLL 1 |
13 | #define ROLL 1 |
14 | 14 | ||
15 | /* |
15 | /* |
16 | * The output BLC throttles can be set in an [0..256[ interval. Some staticParams limits |
16 | * The output BLC throttles can be set in an [0..256[ interval. Some staticParams limits |
17 | * (min, throttle, max throttle etc) are in a [0..256[ interval. |
17 | * (min, throttle, max throttle etc) are in a [0..256[ interval. |
18 | * The calculation of motor throttle values from sensor and control information (basically |
18 | * The calculation of motor throttle values from sensor and control information (basically |
19 | * flight.c) take place in an [0..1024[ interval for better precision. |
19 | * flight.c) take place in an [0..1024[ interval for better precision. |
20 | * This is the conversion factor. |
20 | * This is the conversion factor. |
21 | * --> Replaced back again by CONTROL_SCALING. Even though the 2 things are not quite the |
21 | * --> Replaced back again by CONTROL_SCALING. Even though the 2 things are not quite the |
22 | * same, they are unseperable anyway. |
22 | * same, they are unseperable anyway. |
23 | */ |
23 | */ |
24 | - | ||
25 | extern uint8_t RequiredMotors; |
- | |
26 | 24 | ||
27 | // looping params |
25 | // looping params |
28 | // extern long TurnOver180Nick, TurnOver180Roll; |
26 | // extern long TurnOver180Nick, TurnOver180Roll; |
29 | 27 | ||
30 | // external control |
28 | // external control |
31 | // extern int16_t ExternStickNick, ExternStickRoll, ExternStickYaw; |
29 | // extern int16_t ExternStickNick, ExternStickRoll, ExternStickYaw; |
32 | // extern int16_t naviAccPitch, naviAccRoll, naviCntAcc; |
30 | // extern int16_t naviAccPitch, naviAccRoll, naviCntAcc; |
33 | 31 | ||
34 | // TODO: Rip em up, replace by a flight-state machine. |
32 | // TODO: Rip em up, replace by a flight-state machine. |
35 | // OK first step: Move to control mixer, where the state machine will be located anyway. |
33 | // OK first step: Move to control mixer, where the state machine will be located anyway. |
36 | // extern volatile uint8_t MKFlags; |
34 | // extern volatile uint8_t MKFlags; |
37 | // extern uint16_t isFlying; |
35 | // extern uint16_t isFlying; |
38 | 36 | ||
39 | void flight_control(void); |
37 | void flight_control(void); |
40 | void transmitMotorThrottleData(void); |
38 | void transmitMotorThrottleData(void); |
41 | void flight_setNeutral(void); |
39 | void flight_setNeutral(void); |
42 | 40 | ||
43 | #endif //_FLIGHT_H |
41 | #endif //_FLIGHT_H |
44 | 42 |