2 * Copyright Droids Corporation (2009)
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,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * Revision : $Id: commands.c,v 1.9 2009-11-08 17:24:33 zer0 Exp $
20 * Olivier MATZ <zer0@droids-corp.org>
24 #include <aversive/pgmspace.h>
28 extern parse_pgm_inst_t cmd_reset;
29 extern parse_pgm_inst_t cmd_bootloader;
30 extern parse_pgm_inst_t cmd_encoders;
31 extern parse_pgm_inst_t cmd_pwm;
32 extern parse_pgm_inst_t cmd_adc;
33 extern parse_pgm_inst_t cmd_sensor;
34 extern parse_pgm_inst_t cmd_log;
35 extern parse_pgm_inst_t cmd_log_show;
36 extern parse_pgm_inst_t cmd_log_type;
37 extern parse_pgm_inst_t cmd_stack_space;
38 extern parse_pgm_inst_t cmd_scheduler;
41 extern parse_pgm_inst_t cmd_baudrate;
42 extern parse_pgm_inst_t cmd_uint16_read;
43 extern parse_pgm_inst_t cmd_uint16_write;
44 extern parse_pgm_inst_t cmd_uint8_read;
45 extern parse_pgm_inst_t cmd_uint8_write;
48 extern parse_pgm_inst_t cmd_gain;
49 extern parse_pgm_inst_t cmd_gain_show;
50 extern parse_pgm_inst_t cmd_speed;
51 extern parse_pgm_inst_t cmd_speed_show;
52 extern parse_pgm_inst_t cmd_derivate_filter;
53 extern parse_pgm_inst_t cmd_derivate_filter_show;
54 extern parse_pgm_inst_t cmd_consign;
55 extern parse_pgm_inst_t cmd_maximum;
56 extern parse_pgm_inst_t cmd_maximum_show;
57 extern parse_pgm_inst_t cmd_quadramp;
58 extern parse_pgm_inst_t cmd_quadramp_show;
59 extern parse_pgm_inst_t cmd_cs_status;
60 extern parse_pgm_inst_t cmd_blocking_i;
61 extern parse_pgm_inst_t cmd_blocking_i_show;
63 /* commands_mainboard.c */
64 extern parse_pgm_inst_t cmd_event;
65 extern parse_pgm_inst_t cmd_spi_test;
66 extern parse_pgm_inst_t cmd_opponent;
67 extern parse_pgm_inst_t cmd_opponent_set;
68 extern parse_pgm_inst_t cmd_start;
69 extern parse_pgm_inst_t cmd_interact;
70 extern parse_pgm_inst_t cmd_color;
71 extern parse_pgm_inst_t cmd_rs;
72 extern parse_pgm_inst_t cmd_i2cdebug;
73 extern parse_pgm_inst_t cmd_mechboard_show;
74 extern parse_pgm_inst_t cmd_mechboard_setmode1;
75 extern parse_pgm_inst_t cmd_mechboard_setmode2;
76 extern parse_pgm_inst_t cmd_mechboard_setmode3;
77 extern parse_pgm_inst_t cmd_mechboard_setmode4;
78 extern parse_pgm_inst_t cmd_mechboard_setmode5;
79 extern parse_pgm_inst_t cmd_pickup_wheels;
80 extern parse_pgm_inst_t cmd_beacon_start;
81 extern parse_pgm_inst_t cmd_pump_current;
82 extern parse_pgm_inst_t cmd_build_test;
83 extern parse_pgm_inst_t cmd_column_test;
84 extern parse_pgm_inst_t cmd_column_test2;
85 extern parse_pgm_inst_t cmd_lintel_test;
86 extern parse_pgm_inst_t cmd_pickup_test;
87 extern parse_pgm_inst_t cmd_scan_test;
88 extern parse_pgm_inst_t cmd_scan_test2;
89 extern parse_pgm_inst_t cmd_time_monitor;
90 extern parse_pgm_inst_t cmd_scanner;
91 extern parse_pgm_inst_t cmd_build_z1;
93 extern parse_pgm_inst_t cmd_beacon_opp_dump;
95 extern parse_pgm_inst_t cmd_test;
98 extern parse_pgm_inst_t cmd_traj_speed;
99 extern parse_pgm_inst_t cmd_traj_speed_show;
100 extern parse_pgm_inst_t cmd_trajectory;
101 extern parse_pgm_inst_t cmd_trajectory_show;
102 extern parse_pgm_inst_t cmd_circle_coef;
103 extern parse_pgm_inst_t cmd_circle_coef_show;
104 extern parse_pgm_inst_t cmd_rs_gains;
105 extern parse_pgm_inst_t cmd_rs_gains_show;
106 extern parse_pgm_inst_t cmd_track;
107 extern parse_pgm_inst_t cmd_track_show;
108 extern parse_pgm_inst_t cmd_pt_list;
109 extern parse_pgm_inst_t cmd_pt_list_append;
110 extern parse_pgm_inst_t cmd_pt_list_del;
111 extern parse_pgm_inst_t cmd_pt_list_show;
112 extern parse_pgm_inst_t cmd_goto1;
113 extern parse_pgm_inst_t cmd_goto2;
114 extern parse_pgm_inst_t cmd_goto3;
115 extern parse_pgm_inst_t cmd_goto4;
116 extern parse_pgm_inst_t cmd_position;
117 extern parse_pgm_inst_t cmd_position_set;
118 extern parse_pgm_inst_t cmd_strat_infos;
119 extern parse_pgm_inst_t cmd_strat_conf;
120 extern parse_pgm_inst_t cmd_strat_conf2;
121 extern parse_pgm_inst_t cmd_strat_conf3;
122 extern parse_pgm_inst_t cmd_strat_conf4;
123 extern parse_pgm_inst_t cmd_subtraj;
126 parse_pgm_ctx_t main_ctx[] = {
129 (parse_pgm_inst_t *)&cmd_reset,
130 (parse_pgm_inst_t *)&cmd_bootloader,
131 (parse_pgm_inst_t *)&cmd_encoders,
132 (parse_pgm_inst_t *)&cmd_pwm,
133 (parse_pgm_inst_t *)&cmd_adc,
134 (parse_pgm_inst_t *)&cmd_sensor,
135 (parse_pgm_inst_t *)&cmd_log,
136 (parse_pgm_inst_t *)&cmd_log_show,
137 (parse_pgm_inst_t *)&cmd_log_type,
138 (parse_pgm_inst_t *)&cmd_stack_space,
139 (parse_pgm_inst_t *)&cmd_scheduler,
141 /* commands_ax12.c */
142 (parse_pgm_inst_t *)&cmd_baudrate,
143 (parse_pgm_inst_t *)&cmd_uint16_read,
144 (parse_pgm_inst_t *)&cmd_uint16_write,
145 (parse_pgm_inst_t *)&cmd_uint8_read,
146 (parse_pgm_inst_t *)&cmd_uint8_write,
149 (parse_pgm_inst_t *)&cmd_gain,
150 (parse_pgm_inst_t *)&cmd_gain_show,
151 (parse_pgm_inst_t *)&cmd_speed,
152 (parse_pgm_inst_t *)&cmd_speed_show,
153 (parse_pgm_inst_t *)&cmd_consign,
154 (parse_pgm_inst_t *)&cmd_derivate_filter,
155 (parse_pgm_inst_t *)&cmd_derivate_filter_show,
156 (parse_pgm_inst_t *)&cmd_maximum,
157 (parse_pgm_inst_t *)&cmd_maximum_show,
158 (parse_pgm_inst_t *)&cmd_quadramp,
159 (parse_pgm_inst_t *)&cmd_quadramp_show,
160 (parse_pgm_inst_t *)&cmd_cs_status,
161 (parse_pgm_inst_t *)&cmd_blocking_i,
162 (parse_pgm_inst_t *)&cmd_blocking_i_show,
164 /* commands_mainboard.c */
165 (parse_pgm_inst_t *)&cmd_event,
166 (parse_pgm_inst_t *)&cmd_spi_test,
167 (parse_pgm_inst_t *)&cmd_opponent,
168 (parse_pgm_inst_t *)&cmd_opponent_set,
169 (parse_pgm_inst_t *)&cmd_start,
170 (parse_pgm_inst_t *)&cmd_interact,
171 (parse_pgm_inst_t *)&cmd_color,
172 (parse_pgm_inst_t *)&cmd_rs,
173 (parse_pgm_inst_t *)&cmd_i2cdebug,
174 (parse_pgm_inst_t *)&cmd_mechboard_show,
175 (parse_pgm_inst_t *)&cmd_mechboard_setmode1,
176 (parse_pgm_inst_t *)&cmd_mechboard_setmode2,
177 (parse_pgm_inst_t *)&cmd_mechboard_setmode3,
178 (parse_pgm_inst_t *)&cmd_mechboard_setmode4,
179 (parse_pgm_inst_t *)&cmd_mechboard_setmode5,
180 (parse_pgm_inst_t *)&cmd_pickup_wheels,
181 (parse_pgm_inst_t *)&cmd_beacon_start,
182 (parse_pgm_inst_t *)&cmd_pump_current,
183 (parse_pgm_inst_t *)&cmd_build_test,
184 (parse_pgm_inst_t *)&cmd_column_test,
185 (parse_pgm_inst_t *)&cmd_column_test2,
186 (parse_pgm_inst_t *)&cmd_lintel_test,
187 (parse_pgm_inst_t *)&cmd_pickup_test,
188 (parse_pgm_inst_t *)&cmd_scan_test,
189 (parse_pgm_inst_t *)&cmd_scan_test2,
190 (parse_pgm_inst_t *)&cmd_time_monitor,
191 (parse_pgm_inst_t *)&cmd_scanner,
192 (parse_pgm_inst_t *)&cmd_build_z1,
194 (parse_pgm_inst_t *)&cmd_beacon_opp_dump,
196 (parse_pgm_inst_t *)&cmd_test,
198 /* commands_traj.c */
199 (parse_pgm_inst_t *)&cmd_traj_speed,
200 (parse_pgm_inst_t *)&cmd_traj_speed_show,
201 (parse_pgm_inst_t *)&cmd_trajectory,
202 (parse_pgm_inst_t *)&cmd_trajectory_show,
203 (parse_pgm_inst_t *)&cmd_circle_coef,
204 (parse_pgm_inst_t *)&cmd_circle_coef_show,
205 (parse_pgm_inst_t *)&cmd_rs_gains,
206 (parse_pgm_inst_t *)&cmd_rs_gains_show,
207 (parse_pgm_inst_t *)&cmd_track,
208 (parse_pgm_inst_t *)&cmd_track_show,
209 (parse_pgm_inst_t *)&cmd_pt_list,
210 (parse_pgm_inst_t *)&cmd_pt_list_append,
211 (parse_pgm_inst_t *)&cmd_pt_list_del,
212 (parse_pgm_inst_t *)&cmd_pt_list_show,
213 (parse_pgm_inst_t *)&cmd_goto1,
214 (parse_pgm_inst_t *)&cmd_goto2,
215 (parse_pgm_inst_t *)&cmd_goto4,
216 (parse_pgm_inst_t *)&cmd_position,
217 (parse_pgm_inst_t *)&cmd_position_set,
218 (parse_pgm_inst_t *)&cmd_strat_infos,
219 (parse_pgm_inst_t *)&cmd_strat_conf,
220 (parse_pgm_inst_t *)&cmd_strat_conf2,
221 (parse_pgm_inst_t *)&cmd_strat_conf3,
222 (parse_pgm_inst_t *)&cmd_strat_conf4,
223 (parse_pgm_inst_t *)&cmd_subtraj,