Revision 1169
Added server_comm.c/server_comm.h
Added tests.c/tests.h
main.c | ||
---|---|---|
6 | 6 |
|
7 | 7 |
#include "global.h" |
8 | 8 |
#include "station_hardware.h" |
9 |
#include "tests.h" |
|
9 | 10 |
|
10 |
#include "test_comm.h" |
|
11 |
#include "test_bom.h" |
|
12 |
#include "test_rangefinders.h" |
|
13 |
#include "test_motors.h" |
|
14 |
#include "test_encoders.h" |
|
15 |
|
|
16 |
bool communication_ok=false; |
|
17 |
|
|
18 |
bool require_comm (void) |
|
19 |
{ |
|
20 |
if (!communication_ok) |
|
21 |
communication_ok=test_comm (); |
|
22 |
|
|
23 |
if (!communication_ok) |
|
24 |
usb_puts ("# Communications required. Stop." NL); |
|
25 |
|
|
26 |
return communication_ok; |
|
27 |
} |
|
28 |
|
|
29 |
void test_all (void) |
|
30 |
{ |
|
31 |
// test_all tests comm itself because we want to test comm, even if it |
|
32 |
// succeeded before (that's what test_all means). |
|
33 |
if (!test_comm ()) |
|
34 |
{ |
|
35 |
usb_puts ("# Communications required. Stop." NL); |
|
36 |
return; |
|
37 |
} |
|
38 |
|
|
39 |
test_bom (true, true); |
|
40 |
test_rangefinders (); |
|
41 |
test_encoders (); |
|
42 |
test_motors (); |
|
43 |
} |
|
44 |
|
|
45 | 11 |
void interactive_main (void) |
46 | 12 |
{ |
47 | 13 |
while (1) |
... | ... | |
89 | 55 |
|
90 | 56 |
orb_init_pwm (); |
91 | 57 |
hardware_init (); |
58 |
server_comm_init (); |
|
92 | 59 |
|
93 | 60 |
orb1_set (255, 0, 0); usb_puts("# Initializing wireless" NL); |
94 | 61 |
xbee_init (); |
Also available in: Unified diff