2 * Copyright © 2009 Keith Packard <keithp@keithp.com>
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; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
27 #define AO_ADC_RING 64
28 #define ao_adc_ring_next(n) (((n) + 1) & (AO_ADC_RING - 1))
29 #define ao_adc_ring_prev(n) (((n) - 1) & (AO_ADC_RING - 1))
32 * One set of samples read from the A/D converter
35 uint16_t tick; /* tick when the sample was read */
36 int16_t accel; /* accelerometer */
37 int16_t pres; /* pressure sensor */
38 int16_t temp; /* temperature sensor */
39 int16_t v_batt; /* battery voltage */
40 int16_t sense_d; /* drogue continuity sense */
41 int16_t sense_m; /* main continuity sense */
44 enum ao_flight_state {
45 ao_flight_startup = 0,
57 struct ao_adc ao_adc_ring[AO_ADC_RING];
62 #define ao_timer_set_adc_interval(i)
63 #define ao_wakeup(wchan) ao_dump_state(wchan)
64 #define ao_cmd_register(c)
65 #define ao_usb_disable()
66 #define ao_telemetry_set_interval(x)
70 ao_igniter_drogue = 0,
75 ao_ignite(enum ao_igniter igniter)
77 printf ("ignite %s\n", igniter == ao_igniter_drogue ? "drogue" : "main");
84 #define ao_add_task(t,f,n)
86 #define ao_log_start()
89 #define AO_MS_TO_TICKS(ms) ((ms) / 10)
90 #define AO_SEC_TO_TICKS(s) ((s) * 100)
92 #define AO_FLIGHT_TEST
94 struct ao_adc ao_adc_static;
99 ao_dump_state(void *wchan);
102 ao_sleep(void *wchan);
104 const char * const ao_state_names[] = {
105 "startup", "idle", "pad", "boost", "fast",
106 "coast", "drogue", "main", "landed", "invalid"
116 uint16_t main_deploy;
117 int16_t accel_zero_g;
120 #define ao_config_get()
122 struct ao_config ao_config = { 250, 16000 };
124 #define memcpy(d,s,c) memcpy(d,s,c)
125 #define memset(d,v,c) memset(d,v,c)
126 #define memcmp(d,s,c) memcmp(d,s,c)