Project

General

Profile

Revision 887

Updated trunk branch of wireless... Still won't work though because of Makefile.

View differences:

xbee.c
83 83
static int xbee_enter_command_mode(void);
84 84
static int xbee_exit_command_mode(void);
85 85
static int xbee_enter_api_mode(void);
86
static int xbee_exit_api_mode(void);
87 86
static int xbee_wait_for_string(char* s, int len);
88 87
static int xbee_wait_for_ok(void);
89 88

  
......
213 212
#ifdef FIREFLY
214 213
	UCSR0B |= _BV(RXCIE) | _BV(RXEN);
215 214
#else
215
#ifdef BAYBOARD
216
	UCSR1B |= _BV(RXCIE1);
217
#else
216 218
	UCSR1B |= _BV(RXCIE);
217 219
#endif
220
#endif
218 221
	sei();
219 222
#else
220 223
	xbee_stream = open(xbee_com_port, O_RDWR);
......
730 733
				buffer_first = 0;
731 734
			// check if buffer is empty
732 735
			if (buffer_first == buffer_last) {
733
				return 0;
736
				return -1;
734 737
			}
735 738
		} while (arrival_buf[buffer_first++] != XBEE_FRAME_START);
736 739

  
......
762 765

  
763 766
		// check if buffer is empty
764 767
		if (buffer_first == buffer_last) {
765
			return 0;
768
			return -1;
766 769
		}
767 770
		xbee_buf[currentBufPos++] = arrival_buf[buffer_first++];
768 771
		if (buffer_first == XBEE_BUFFER_SIZE) {
......
780 783

  
781 784
	//we will take care of the packet
782 785
	if (xbee_handle_packet(xbee_buf + 3, len) != 0) {
783
		return 0;
786
		return -1;
784 787
	}
785 788

  
786 789
	if (dest == NULL) {
787
		return 0;
790
		return -1;
788 791
	}
789 792

  
790 793
	int i;

Also available in: Unified diff