Subversion Repositories Code-Repo

Rev

Rev 109 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
107 Kevin 1
#ifndef __maindefs_h
2
#define __maindefs_h
3
 
4
#include <p18f27j13.h>
5
#include <stdio.h>
6
 
7
//#define _DEBUG
111 Kevin 8
#define _BASE_STATION
9
//#define _REMOTE
107 Kevin 10
 
11
// Enable or disable debug prints depending on project preprocessor (_DEBUG)
12
#ifdef _DEBUG
13
#define DBG_PRINT_MAIN(x) printf(x)
109 Kevin 14
#define DBG_PRINT_I2C(x)
107 Kevin 15
#define DBG_PRINT_XBEE(x)
111 Kevin 16
#define DBG_PRINT_PORTB_INT(x) printf(x)
17
#define DBG_PRINT_INT(x) printf(x)
18
#define DBG_PRINT_BUFFER(x)
107 Kevin 19
#else
20
#define DBG_PRINT_MAIN(x)
21
#define DBG_PRINT_I2C(x)
22
#define DBG_PRINT_XBEE(x)
23
#define DBG_PRINT_PORTB_INT(x)
111 Kevin 24
#define DBG_PRINT_INT(x)
25
#define DBG_PRINT_BUFFER(x)
107 Kevin 26
#endif
27
 
28
//#define memcpy(a,b,c)   memcpy((a),(const void*)(b),(c))
29
//#define memcmp(a,b,c)   memcmp((const void*)(a),(const void*)(b),(c))
30
//#define strcpy(a,b)     strcpy((char*)(a),(const char*)(b))
31
 
32
// Message type definitions
33
#define MSGTYPE_RESEND 1
34
 
35
#define MSGTYPE_TIMER0      10
36
#define MSGTYPE_TIMER1      11
37
#define MSGTYPE_TIMER2      12
38
#define MSGTYPE_TIMER3      13
39
#define MSGTYPE_TIMER4      14
40
#define MSGTYPE_TIMER5      15
41
#define MSGTYPE_TIMER6      16
42
#define MSGTYPE_TIMER8      17
43
#define MSGTYPE_MAIN1       20
44
#define	MSGTYPE_OVERRUN     30
45
#define MSGTYPE_UART_DATA   31
46
#define MSGTYPE_I2C_DBG     40
47
#define	MSGTYPE_I2C_DATA    41
48
#define MSGTYPE_I2C_REPLY   42
49
//#define MSGTYPE_I2C_RQST 43
50
 
51
// Unused (Used for I2C Master Mode)
52
#define MSGTYPE_I2C_MASTER_SEND_COMPLETE    43
53
#define MSGTYPE_I2C_MASTER_SEND_FAILED      44
54
#define MSGTYPE_I2C_MASTER_RECV_COMPLETE    45
55
#define MSGTYPE_I2C_MASTER_RECV_FAILED      46
56
 
57
#define MSGTYPE_ADC_NEWVALUE 50
58
 
59
#define MSGTYPE_XBEE_RX_AT_COMMAND_RESPONSE         60
60
#define MSGTYPE_XBEE_RX_DATA_PACKET                 61
61
#define MSGTYPE_XBEE_RX_DATA_TX_STATUS              62
62
#define MSGTYPE_XBEE_RX_IO_DATA_SAMPLE              63
63
#define MSGTYPE_XBEE_RX_EXPLICIT_COMMAND            64
64
#define MSGTYPE_XBEE_RX_REMOTE_AT_COMMAND_RESPONSE  65
65
#define MSGTYPE_XBEE_RX_ROUTE_RECORD                66
66
#define MSGTYPE_XBEE_RX_NODE_IDENTIFICATION         67
67
#define MSGTYPE_XBEE_RX_FRAME_MODEM_STATUS          68
68
 
69
#define MSGTYPE_PORTB_4_DOWN    70
70
#define MSGTYPE_PORTB_4_UP      71
71
#define MSGTYPE_PORTB_5_DOWN    72
72
#define MSGTYPE_PORTB_5_UP      73
73
#define MSGTYPE_PORTB_6_DOWN    74
74
#define MSGTYPE_PORTB_6_UP      75
75
#define MSGTYPE_PORTB_7_DOWN    76
76
#define MSGTYPE_PORTB_7_UP      77
77
 
78
 
79
#endif
80