root / branches / autonomous_recharging / code / projects / autonomous_recharging / charging_station / wl_defs.h @ 363
History | View | Annotate | Download (2.59 KB)
1 | 337 | bcoltin | /**
|
---|---|---|---|
2 | * Copyright (c) 2007 Colony Project
|
||
3 | *
|
||
4 | * Permission is hereby granted, free of charge, to any person
|
||
5 | * obtaining a copy of this software and associated documentation
|
||
6 | * files (the "Software"), to deal in the Software without
|
||
7 | * restriction, including without limitation the rights to use,
|
||
8 | * copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||
9 | * copies of the Software, and to permit persons to whom the
|
||
10 | * Software is furnished to do so, subject to the following
|
||
11 | * conditions:
|
||
12 | *
|
||
13 | * The above copyright notice and this permission notice shall be
|
||
14 | * included in all copies or substantial portions of the Software.
|
||
15 | *
|
||
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||
17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||
18 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||
19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||
20 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||
21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||
22 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||
23 | * OTHER DEALINGS IN THE SOFTWARE.
|
||
24 | **/
|
||
25 | |||
26 | /**
|
||
27 | * @file wl_defs.h
|
||
28 | * @brief Definitions for Wireless
|
||
29 | *
|
||
30 | * Contains definitions for wireless packet groups, packet types,
|
||
31 | * debugging information, etc.
|
||
32 | *
|
||
33 | * @author Brian Coltin, Colony Project, CMU Robotics Club
|
||
34 | **/
|
||
35 | |||
36 | 198 | bcoltin | #ifndef WL_DEFS_H
|
37 | #define WL_DEFS_H
|
||
38 | |||
39 | 85 | bcoltin | //comment out this line if using a computer hooked up to an xbee
|
40 | //#define ROBOT
|
||
41 | |||
42 | //uncomment this line for debug information
|
||
43 | 120 | bcoltin | //#define WL_DEBUG
|
44 | 85 | bcoltin | |
45 | // Packet Groups and Types
|
||
46 | |||
47 | // Error group
|
||
48 | #define WL_ERROR_GROUP 1 |
||
49 | |||
50 | #define WL_ERROR_STRING_TYPE 1 |
||
51 | |||
52 | // Token Ring group
|
||
53 | #define WL_TOKEN_RING_GROUP 2 |
||
54 | |||
55 | #define WL_TOKEN_PASS 1 |
||
56 | #define WL_TOKEN_BOM_ON 2 |
||
57 | 198 | bcoltin | #define WL_TOKEN_JOIN 3 |
58 | #define WL_TOKEN_JOIN_ACCEPT 4 |
||
59 | 85 | bcoltin | |
60 | // timing constants
|
||
61 | 166 | bcoltin | #ifndef FIREFLY
|
62 | 337 | bcoltin | #define BOM_DELAY 100 |
63 | 198 | bcoltin | #else
|
64 | 337 | bcoltin | #define BOM_DELAY 200 |
65 | 166 | bcoltin | #endif
|
66 | |||
67 | #define DEATH_DELAY 4 |
||
68 | 85 | bcoltin | #define JOIN_DELAY 8 |
69 | |||
70 | // Recharging group
|
||
71 | #define WL_RECHARGE_GROUP 3 |
||
72 | |||
73 | #define WL_RECHARGE_POLL_STATIONS 1 |
||
74 | #define WL_RECHARGE_STATION_AVAILABLE 2 |
||
75 | #define WL_RECHARGE_REQUEST 3 |
||
76 | #define WL_RECHARGE_REQUEST_ACCEPT 4 |
||
77 | #define WL_RECHARGE_VERIFY 5 |
||
78 | #define WL_RECHARGE_CANCEL 6 |
||
79 | #define WL_RECHARGE_SEEKING 7 |
||
80 | #define WL_RECHARGE_DOCKED 8 |
||
81 | 363 | chihsiuh | #define WL_RECHARGE_BATTERY 11 |
82 | 85 | bcoltin | |
83 | #ifdef WL_DEBUG
|
||
84 | |||
85 | #ifdef ROBOT
|
||
86 | #include <serial.h> |
||
87 | #endif
|
||
88 | |||
89 | #ifdef ROBOT
|
||
90 | #define WL_DEBUG_PRINT( s ) usb_puts( s )
|
||
91 | #else
|
||
92 | #define WL_DEBUG_PRINT( s ) printf( s )
|
||
93 | #endif
|
||
94 | |||
95 | #ifdef ROBOT
|
||
96 | #define WL_DEBUG_PRINT_INT( i ) usb_puti(i)
|
||
97 | #else
|
||
98 | #define WL_DEBUG_PRINT_INT( i ) printf("%i", i) |
||
99 | #endif
|
||
100 | |||
101 | #else
|
||
102 | |||
103 | #define WL_DEBUG_PRINT( s )
|
||
104 | #define WL_DEBUG_PRINT_INT( i )
|
||
105 | |||
106 | #endif
|
||
107 | |||
108 | 198 | bcoltin | #endif
|