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; version 2 of the License.
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.
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.
20 static const char * __xdata flight_reports[] = {
21 "...", /* startup, 'S' */
23 ".--.", /* launchpad 'P' */
24 "-...", /* boost 'B' */
25 "-.-.", /* coast 'C' */
26 ".-", /* apogee 'A' */
27 "-..", /* drogue 'D' */
29 ".-..", /* landed 'L' */
30 ".-.-.-", /* invalid */
34 #define signal(time) ao_beep_for(AO_BEEP_MID, time)
36 #define signal(time) ao_led_for(AO_LED_RED, time)
38 #define pause(time) ao_delay(time)
40 static __xdata enum ao_flight_state ao_report_state;
45 char *r = flight_reports[ao_report_state];
52 signal(AO_MS_TO_TICKS(200));
54 signal(AO_MS_TO_TICKS(600));
55 pause(AO_MS_TO_TICKS(200));
57 pause(AO_MS_TO_TICKS(400));
63 ao_report_state = ao_flight_state;
67 while (ao_report_state == ao_flight_state)
68 ao_sleep(DATA_TO_XDATA(&ao_flight_state));
69 ao_report_state = ao_flight_state;
74 static __xdata struct ao_task ao_report_task;
79 ao_add_task(&ao_report_task, ao_report, "report");