Subversion Repositories Code-Repo

Rev

Rev 113 | Rev 115 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 113 Rev 114
Line 3... Line 3...
3
 
3
 
4
#include <p18f26j11.h>
4
#include <p18f26j11.h>
5
#include <stdio.h>
5
#include <stdio.h>
6
 
6
 
7
//#define _DEBUG
7
//#define _DEBUG
-
 
8
#define _BASE_STATION
-
 
9
//#define _REMOTE
-
 
10
 
-
 
11
#ifdef _BASE_STATION
-
 
12
#define _SPI2_V2
-
 
13
#endif
-
 
14
#ifdef _REMOTE
8
#define _SPI2_V1
15
#define _SPI2_V1
-
 
16
#endif
-
 
17
 
9
//#define _SPI2_V2
18
#define BASE_STATION_ADDRESS 81
10
 
19
 
11
// Enable or disable debug prints depending on project preprocessor (_DEBUG)
20
// Enable or disable debug prints depending on project preprocessor (_DEBUG)
12
#ifdef _DEBUG
21
#ifdef _DEBUG
13
#define DBG_PRINT_MAIN(x) printf(x)
22
#define DBG_PRINT_MAIN(x) printf(x)
14
#define DBG_PRINT_I2C(x)
23
#define DBG_PRINT_I2C(x)
Line 25... Line 34...
25
#define DBG_PRINT_BUFFER(x)
34
#define DBG_PRINT_BUFFER(x)
26
#endif
35
#endif
27
 
36
 
28
#define RETURNID_ACC    10
37
#define RETURNID_ACC    10
29
#define RETURNID_GYRO   11
38
#define RETURNID_GYRO   11
-
 
39
#define RETURNID_CONN   12
30
#define RETURNID_BTN1   12
40
#define RETURNID_BTN1   13
31
#define RETURNID_BTN2   13
41
#define RETURNID_BTN2   14
32
 
42
 
33
// Message type definitions
43
// Message type definitions
34
#define MSGTYPE_RESEND 1
44
#define MSGTYPE_RESEND 1
35
 
45
 
36
#define MSGTYPE_TIMER0      10
46
#define MSGTYPE_TIMER0      10
Line 84... Line 94...
84
    I2C_STATE_READ_GYRO
94
    I2C_STATE_READ_GYRO
85
};
95
};
86
 
96
 
87
enum XBEE_STATE {
97
enum XBEE_STATE {
88
    XBEE_STATE_WAITING_TO_JOIN,
98
    XBEE_STATE_WAITING_TO_JOIN,
89
    XBEE_STATE_JOINED_NETWORK
99
    XBEE_STATE_JOINED_NETWORK,
-
 
100
    XBEE_STATE_QUERY_PARENT
90
};
101
};
91
 
102
 
92
#endif
103
#endif
93
 
104