Project

General

Profile

Statistics
| Revision:

root / trunk / code / projects / libwireless / lib / wl_defs.h @ 159

History | View | Annotate | Download (1.25 KB)

1
#ifndef WL_DEFS_H
2
#define WL_DEFS_H
3

    
4
//comment out this line if using a computer hooked up to an xbee
5
//#define ROBOT
6

    
7
//uncomment this line for debug information
8
//#define WL_DEBUG
9

    
10
// Packet Groups and Types
11

    
12
// Error group
13
#define WL_ERROR_GROUP 1
14

    
15
#define WL_ERROR_STRING_TYPE 1
16

    
17
// Token Ring group
18
#define WL_TOKEN_RING_GROUP 2
19

    
20
#define WL_TOKEN_PASS 1
21
#define WL_TOKEN_BOM_ON 2
22
#define WL_TOKEN_INTERRUPT_REQUEST 3
23
#define WL_TOKEN_INTERRUPT_PASS 4
24
#define WL_TOKEN_JOIN 5
25
#define WL_TOKEN_JOIN_ACCEPT 6
26

    
27
// timing constants
28
#define BOM_DELAY 100
29
#define DEATH_DELAY 4
30
#define JOIN_DELAY 8
31

    
32
// Recharging group
33
#define WL_RECHARGE_GROUP 3
34

    
35
#define WL_RECHARGE_POLL_STATIONS 1
36
#define WL_RECHARGE_STATION_AVAILABLE 2
37
#define WL_RECHARGE_REQUEST 3
38
#define WL_RECHARGE_REQUEST_ACCEPT 4
39
#define WL_RECHARGE_VERIFY 5
40
#define WL_RECHARGE_CANCEL 6
41
#define WL_RECHARGE_SEEKING 7
42
#define WL_RECHARGE_DOCKED 8
43

    
44
#ifdef WL_DEBUG
45

    
46
#ifdef ROBOT
47
#include <serial.h>
48
#endif
49

    
50
#ifdef ROBOT
51
#define WL_DEBUG_PRINT( s ) usb_puts( s )
52
#else
53
#define WL_DEBUG_PRINT( s ) printf( s )
54
#endif
55

    
56
#ifdef ROBOT
57
#define WL_DEBUG_PRINT_INT( i ) usb_puti(i)
58
#else
59
#define WL_DEBUG_PRINT_INT( i ) printf("%i", i)
60
#endif
61

    
62
#else
63

    
64
#define WL_DEBUG_PRINT( s )
65
#define WL_DEBUG_PRINT_INT( i )
66

    
67
#endif
68

    
69
#endif