Revision 706
This is the first attempt at porting the wireless library to the charge bay board. This mostly involved a lot of complicated #defines to change hardware interface. ROBOT and BAYBOARD should be defined when compiling, which currently I think is handled in the Makefile with -D arguments. This code does not work, still working on debugging.
xbee.c | ||
---|---|---|
160 | 160 |
} |
161 | 161 |
#else |
162 | 162 |
#ifdef BAYBOARD |
163 |
// TODO: interrupt handler for bayboard, should be similar to above and below |
|
163 |
ISR(USART1_RX_vect) |
|
164 |
{ |
|
165 |
char c = UDR1; |
|
166 |
arrival_buf[buffer_last] = c; |
|
167 |
int t = buffer_last + 1; |
|
168 |
if (t == XBEE_BUFFER_SIZE) |
|
169 |
t = 0; |
|
170 |
if (t == buffer_first) |
|
171 |
{ |
|
172 |
WL_DEBUG_PRINT("Out of space in buffer.\n"); |
|
173 |
} |
|
174 |
buffer_last = t; |
|
175 |
} |
|
164 | 176 |
#else |
165 | 177 |
ISR(USART1_RX_vect) |
166 | 178 |
{ |
... | ... | |
230 | 242 |
UCSR0B |= _BV(RXCIE) | _BV(RXEN); |
231 | 243 |
#else |
232 | 244 |
#ifdef BAYBOARD |
233 |
//TODO: enable the receiving interrupt on the bayboard
|
|
245 |
UCSR1B |= _BV(RXCIE0);
|
|
234 | 246 |
#else |
235 | 247 |
UCSR1B |= _BV(RXCIE); |
236 | 248 |
#endif |
Also available in: Unified diff