Project

General

Profile

Revision 86

Updated wireless library, fixing bug and now works for a firefly if FIREFLY is defined.

View differences:

xbee.c
92 92
 * Interrupt for the robot. Adds bytes received from the xbee
93 93
 * to the queue.
94 94
 **/
95
#ifndef FIREFLY
95 96
ISR(USART1_RX_vect)
96 97
{
97 98
	char c = UDR1;
98 99
	queue_add(xbee_queue, (void*)(int)c);
99 100
}
101
#else
102
SIGNAL(SIG_USART0_RECV)
103
{
104
	char c = UDR0;
105
	queue_add(xbee_queue, (void*)(int)c);
106
}
107
#endif
100 108

  
101 109
#else
102 110

  
......
129 137
	#ifdef ROBOT
130 138

  
131 139
	//enable the receiving interrupt
140
	#ifdef FIREFLY
141
	UCSR0B |= _BV(RXCIE) | _BV(RXEN);
142
	#else
132 143
	UCSR1B |= _BV(RXCIE);
144
	#endif
133 145
	sei();
134 146
	#else
135 147
	xbee_stream = open("/dev/ttyUSB0", O_RDWR);

Also available in: Unified diff