Revision 1615
fixed references to handler array, wireless_receive compiles now
branches/wireless/code/projects/libwireless/wireless_receive.c | ||
---|---|---|
60 | 60 |
extern uint8_t basic_buf_last; // end of last packet in basic buffer |
61 | 61 |
extern uint8_t other_buf_first; // beginning of first packet in other buffer |
62 | 62 |
extern uint8_t other_buf_last; // end of last packet in other buffer |
63 |
extern void (*handlers[])(void); // array of pointers to normal-priority packet handlers |
|
64 | 63 |
|
65 | 64 |
/** |
66 | 65 |
* @addtogroup wireless Wireless |
... | ... | |
144 | 143 |
*/ |
145 | 144 |
buf_pos++; |
146 | 145 |
group = xbee_other_buf[buf_pos]; // get group from packet |
147 |
if (group >= WL_NUM_PACKET_GROUPS) // invalid group number
|
|
146 |
if (group >= MAX_PACKET_GROUPS) // invalid group number
|
|
148 | 147 |
buf_pos += length - 1 + 1; // go to first byte of next packet |
149 | 148 |
else { // valid group number |
150 |
handler = handlers[group].FUNC; // get function from handler array |
|
149 |
handler = wl_packet_handlers[group].FUNC; // get function from handler array
|
|
151 | 150 |
buf_pos++; |
152 | 151 |
buf_pos++; // ignore 1st byte of ID (will be all 0s) |
153 | 152 |
source = xbee_other_buf[buf_pos]; // get sender ID from packet |
branches/wireless/code/projects/libwireless/wireless.h | ||
---|---|---|
129 | 129 |
|
130 | 130 |
} PacketGroupHandler; |
131 | 131 |
|
132 |
static PacketGroupHandler wl_packet_handlers[MAX_PACKET_GROUPS]; |
|
132 | 133 |
|
133 | 134 |
/**@defgroup wl_functions Public API Functions |
134 | 135 |
* @{ **/ |
branches/wireless/code/projects/libwireless/wireless.c | ||
---|---|---|
45 | 45 |
**/ |
46 | 46 |
|
47 | 47 |
static uint8_t init_flag = INIT_NO; |
48 |
static PacketGroupHandler wl_packet_handlers[MAX_PACKET_GROUPS]; |
|
49 | 48 |
|
50 | 49 |
/** |
51 | 50 |
* initialization function: |
Also available in: Unified diff