altos: Add arbitrary pyro channel support
[fw/altos] / src / core / ao_flight.h
1 /*
2  * Copyright © 2012 Keith Packard <keithp@keithp.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; version 2 of the License.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11  * General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License along
14  * with this program; if not, write to the Free Software Foundation, Inc.,
15  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
16  */
17
18 #ifndef _AO_FLIGHT_H_
19 #define _AO_FLIGHT_H_
20
21
22 /*
23  * ao_flight.c
24  */
25
26 enum ao_flight_state {
27         ao_flight_startup = 0,
28         ao_flight_idle = 1,
29         ao_flight_pad = 2,
30         ao_flight_boost = 3,
31         ao_flight_fast = 4,
32         ao_flight_coast = 5,
33         ao_flight_drogue = 6,
34         ao_flight_main = 7,
35         ao_flight_landed = 8,
36         ao_flight_invalid = 9
37 };
38
39 extern __pdata enum ao_flight_state     ao_flight_state;
40 extern __pdata uint16_t                 ao_boost_tick;
41 #if AO_PYRO_NUM
42 extern __pdata uint16_t                 ao_motor_number;
43 #endif
44
45 extern __pdata uint16_t                 ao_launch_time;
46 extern __pdata uint8_t                  ao_flight_force_idle;
47
48 /* Flight thread */
49 void
50 ao_flight(void);
51
52 /* Initialize flight thread */
53 void
54 ao_flight_init(void);
55
56 /*
57  * ao_flight_nano.c
58  */
59
60 void
61 ao_flight_nano_init(void);
62
63 #endif /* _AO_FLIGHT_H_ */